Implementation:Google deepmind Mujoco USD Mujoco To USD
| Knowledge Sources | |
|---|---|
| Domains | USD, Model Conversion |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Converts a complete MuJoCo model (mjSpec) into a USD stage, mapping bodies, geoms, joints, actuators, tendons, lights, materials, and global options to their USD equivalents.
Description
mujoco_to_usd.cc is the core conversion engine that transforms MuJoCo model specifications into Universal Scene Description representations. The file imports extensively from both the Pixar USD SDK (SdfPath, UsdGeom, UsdPhysics, UsdShade, UsdLux) and the MjcPhysics custom schema library. It maps MuJoCo's body hierarchy to USD prim paths, converts joints to USD physics joint types (revolute, prismatic, spherical, fixed), translates geoms to USD geometry with materials, and applies MjcPhysics API schemas for MuJoCo-specific parameters. A kWorldIndex constant identifies the world body, and private TfToken definitions provide additional conversion-specific tokens.
Usage
Called by the MJCF file format plugin when USD requests to open a .xml MuJoCo model file, or directly by applications that need to export MuJoCo models to USD format. The conversion produces a fully populated USD stage suitable for rendering in USD-compatible viewers or further processing in USD pipelines.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/usd/plugins/mjcf/mujoco_to_usd.cc
- Lines: 1-2375
Key Functions
// Full MuJoCo-to-USD conversion pipeline
// Maps bodies, geoms, joints, actuators, tendons, lights, materials
// Uses: UsdPhysics::RevoluteJoint, PrismaticJoint, SphericalJoint, FixedJoint
// Applies: MjcPhysicsSceneAPI, MjcPhysicsJointAPI, MjcPhysicsActuator, MjcPhysicsTendon
static constexpr int kWorldIndex = 0;
Import
#include "mjcf/mujoco_to_usd.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| mjSpec | mjSpec* | Yes | MuJoCo model specification to convert |
| mjModel | mjModel* | Yes | Compiled MuJoCo model for runtime data |
Outputs
| Name | Type | Description |
|---|---|---|
| USD Stage | UsdStageRefPtr | Fully populated USD stage with MuJoCo model hierarchy, physics, materials, and lights |