Implementation:Google deepmind Mujoco USD SceneAPI
| Knowledge Sources | |
|---|---|
| Domains | USD, Physics Schema |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Implements the MjcPhysicsSceneAPI USD applied API schema for representing MuJoCo global simulation options (timestep, solver, integrator, compiler flags) on a USD physics scene prim.
Description
sceneAPI.cpp provides the USD schema implementation for MjcPhysicsSceneAPI, an applied API schema derived from UsdAPISchemaBase. This is the largest of the MjcPhysics schemas, reflecting the extensive set of global simulation parameters in MuJoCo's mjOption and mjCompiler structures. The file registers the schema via TfType, implements CanApply/Apply for API application validation, and exposes attribute accessors for timestep, integrator type, solver options, contact parameters, compiler settings, and more via MjcPhysicsTokens.
Usage
Applied to the root physics scene prim during MuJoCo-to-USD export. It captures the full set of MuJoCo global simulation parameters so that a round-trip conversion preserves simulation fidelity. When importing USD files back to MuJoCo, these attributes are read to reconstruct the mjOption settings.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/usd/mjcPhysics/sceneAPI.cpp
- Lines: 1-871
Key Functions
TF_REGISTRY_FUNCTION(TfType); // Registers MjcPhysicsSceneAPI
bool MjcPhysicsSceneAPI::CanApply(const UsdPrim& prim, std::string* whyNot);
MjcPhysicsSceneAPI MjcPhysicsSceneAPI::Apply(const UsdPrim& prim);
UsdAttribute MjcPhysicsSceneAPI::GetTimestepAttr() const;
// Extensive attribute accessors for integrator, solver, compiler, contact parameters
Import
#include <mujoco/experimental/usd/mjcPhysics/sceneAPI.h>
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| prim | UsdPrim | Yes | USD physics scene prim to augment with MuJoCo options |
| stage | UsdStagePtr | No | USD stage for Get operations |
| path | SdfPath | No | Path to the scene prim |
Outputs
| Name | Type | Description |
|---|---|---|
| MjcPhysicsSceneAPI | MjcPhysicsSceneAPI | Applied API schema with MuJoCo simulation option attributes |
| UsdAttribute | UsdAttribute | Individual attribute accessors for timestep, integrator, solver, compiler, etc. |