Files
Mujoco_WASM/python/mujoco/usd/demo.py
T
Abhishek Joshi a2dfc6d17e updating imports
2024-04-10 14:21:46 -05:00

21 lines
430 B
Python

import mujoco
from mujoco.usd import exporter
if __name__ == "__main__":
# load a model to mujoco
m = mujoco.MjModel.from_xml_path("/Users/abhishek/Documents/research/mujoco/test/engine/testdata/catenary.xml")
d = mujoco.MjData(m)
# create an instance of the USDExporter
exp = exporter.USDExporter(model=m)
for i in range(100):
mujoco.mj_step(m, d)
exp.update_scene(d)
exp.save_scene(filetype="usd")