Skip to main content

A CLI for processing composite Wavefront OBJ files for use in MuJoCo

Project description

obj2mjcf

PyPI Python Version PyPI version

obj2mjcf is a CLI for proccessing composite Wavefront OBJ files for use in MuJoCo. It automatically:

  • Splits an OBJ file into sub-meshes that are grouped by the materials referenced in the OBJ's MTL file
  • Generates an MJCF XML file that is pre-filled with materials, meshes and geom elements referencing these OBJ files
  • Optionally generates a collision mesh by performing a convex decomposition of the OBJ using V-HACD

obj2mjcf was used to process model meshes for MuJoCo Menagerie:

Motivation

As of June 2022, MuJoCo does not support composite OBJ files consisting of groups or objects (o or g OBJ tags) and only 1 material can be assigned per mesh. This means that you have to manually split your OBJ file into sub-meshes, a process that is tedious and error-prone. This tool is meant to automate this process.

Installation

The recommended way to install this package is via PyPI:

pip install --upgrade obj2mjcf

Extra: V-HACD 4.0

We recommend installing V-HACD v4.0. If available, obj2mjcf will leverage it to create better collision geometry for your OBJ file.

# For macOS and Linux.
bash install_vhacd.sh

Usage

Type the following at the command line for a detailed description of available options:

obj2mjcf --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obj2mjcf-0.0.23.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

obj2mjcf-0.0.23-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file obj2mjcf-0.0.23.tar.gz.

File metadata

  • Download URL: obj2mjcf-0.0.23.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for obj2mjcf-0.0.23.tar.gz
Algorithm Hash digest
SHA256 6b6e57274e7db72ca36ce72b93812e3153b6df468c2f62136e055f12c24bf416
MD5 88d15a178592d3733a26a3f478d9c7dc
BLAKE2b-256 98c964b30ca604ca882436c8f98d656a8ed99e276f4331f7a2bb480b2ac87ade

See more details on using hashes here.

File details

Details for the file obj2mjcf-0.0.23-py3-none-any.whl.

File metadata

  • Download URL: obj2mjcf-0.0.23-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for obj2mjcf-0.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 c829e3f7dcec721cd4ecf5b2c5cae87728d02b25cec67fb036f4153eff832796
MD5 294c1c5ab151870af15b4f4d34a12c93
BLAKE2b-256 b80bf75fbe6236c61e07cc6fc2efaec1677c2dd0d07a0c57f24d4e2c6f8ea410

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page