Skip to main content

Lightweight scene editor for mujoco

Project description

Supported Python Versions PyPI version License Code style

Scene Editor for MuJoCo

Lightweight, interactive scene editor for MuJoCo 3.x. Create or edit scenes in your browser to place shapes, import meshes, add robots, and edit elements interactively.

Quickstart

pip install mujoco-scene-editor

# Start a fresh, empty scene
mjcreate

# Load from MJCF XML or a blueprint JSON
mjedit path/to/scene.xml

Installation

Install the package on PyPi with

pip install mujoco-scene-editor

This installs necessary dependencies and exposes console scripts. The following entry points are available and they are also accessible as scene-editor subcommands:

  • mjcreate: Create an empty scene (opens the web browser)
  • mjedit: Edit an existing scene (opens the web browser)
  • mjprompt: Generate a scene from a prompt and save it as a MuJoCo XML

From a local checkout:

pip install -e .
# or with dev tools
pip install -e '.[dev]'

To run with uv, use

# Run the installed console script via uv
uv run scene-editor --help
uv run scene-editor new

When the server starts, it prints the URL and opens your browser. Quit with Ctrl+C or the "Quit server" button.

Examples

Use the provided chemistry lab MJCF as a starting point:

# With pip-installed package
mjedit examples/prompt/scene_chemistry_lab.xml

# With uv (no install)
uv run --with mujoco-scene-editor mjedit examples/prompt/scene_chemistry_lab.xml

Then:

  • Use "Add Box/Sphere/Cylinder" to place primitive geoms.
  • Use "Add Asset" to insert a local mesh from your file system.
  • Drag the gizmo to change pose; use “Export” to write MJCF/JSON.

Robot models are detected using a heuristic. See the section below on how to configure the editor to use different robot models.

Prompting / Scene Generation Examples

You can conveniently generate a MuJoCo scene from a natural-language prompt (requires an OpenAI API key):

# Set this to your API key
export OPENAI_API_KEY=...
# Generate a scene from a prompt string
mjprompt

# Edit the generated scene. 
mjedit examples/prompt/scene_coffee_shop.xml

Loading a generated scene might not work out of the box in all cases. Generated scenes can have inconsistencies in geometry, but can be easily edited.

Examples

Below are some generated example scenes. More examples are available in the examples/prompt folder.

Living Room
Living Room
Chess Table
Chess Table
Playground
Playground
Chemistry Lab
Chemistry Lab

Working with different robots or cameras

Robot models must be specified with a JSON configuration. To work with additional robot models, set the ROBITS_CONFIG_DIR environment variable to another config folder. See the RoBits documentation for more details.

  export ROBITS_CONFIG_DIR=$HOME/code/robits/robits_config/additional_config_sim
  mjedit examples/prompt/scene_coffee_shop.xml

Limitations

  • Importing MuJoCo XML files may alter the internal structure, and some tags are discarded.
    • Joints/actuators are discarded if they are not part of a robot description.
    • Additional geom tags, including friction, conaffinity, or contype are not yet supported and discarded.
    • Light/option/compiler elements are not implemented yet.

If you are looking for a robot editor for MuJoCo that supports all the assets please checkout Robola web

  • Not all MuJoCo robot descriptions have an equivalent URDF representation.

Links

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

mujoco_scene_editor-0.1.3.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mujoco_scene_editor-0.1.3-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file mujoco_scene_editor-0.1.3.tar.gz.

File metadata

  • Download URL: mujoco_scene_editor-0.1.3.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mujoco_scene_editor-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4a7887cc8944cfed9c0c4c95f147b6e5d3f3de58ec5246edfe41ce3ade2ff27b
MD5 e09f3845284402c43192cac8a2082bdf
BLAKE2b-256 30ee2d11fd6e1b5e15c6e7fb32b3781ed13846e71b052efaa96f384632c83819

See more details on using hashes here.

Provenance

The following attestation bundles were made for mujoco_scene_editor-0.1.3.tar.gz:

Publisher: publish-to-test-pypi.yml on markusgrotz/mujoco-scene-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mujoco_scene_editor-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mujoco_scene_editor-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2bd000ccdf3fff8dd07110a123e4d384b7fea8f187b2e854eb19f433ee95e6
MD5 1d468d627f5515974feaead2164b4d38
BLAKE2b-256 fe3bf125578e19f17f61d723e79c21cc272d79e1d8dce43621043e9207ba9e67

See more details on using hashes here.

Provenance

The following attestation bundles were made for mujoco_scene_editor-0.1.3-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on markusgrotz/mujoco-scene-editor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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