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 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.2.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.2-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mujoco_scene_editor-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 1923e5bbb4df48160191eb03a37c6d1338bc5833c096668d4b901a01c4c2bcde
MD5 441c48ee6f9fb6ec64b18dcabfaabe13
BLAKE2b-256 2669226d47b60b0edf9e6f927fe3ad3d449ee7f956e76471eb9636faeabc0c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for mujoco_scene_editor-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mujoco_scene_editor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f45d5b1f1a22852cb75d59dd4dfd9e8a31c3a1d9f45b069d1e7e548b699e8385
MD5 928a854b29479bf2c441d8f5faffeb1d
BLAKE2b-256 24e7c2558ae64b300d8271938c0dcaeae3fed1746b74753d0993821ec452280d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mujoco_scene_editor-0.1.2-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