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.
pip install mujoco-scene-editor
# Start a fresh, empty scene
mjcreate
# Load from MJCF XML or a blueprint JSON
mjedit path/to/scene.xmlInstall the package on PyPi with
pip install mujoco-scene-editorThis 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 newWhen the server starts, it prints the URL and opens your browser. Quit with Ctrl+C or the "Quit server" button.
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.xmlThen:
- 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.
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.xmlLoading 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.
Below are some generated example scenes. More examples are available in the examples/prompt folder.
Living Room |
Chess Table |
Playground |
Chemistry Lab |
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- 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.
