Skip to content

Unity Import MuJoCo Scene Error #3180

@Lrogic

Description

@Lrogic

Intro

Hi!

I am a graduate student at UBC using MuJoCo for robotics research in Unity. I am trying to import a Unitree G1 MJCF model into the MuJoCo Unity plugin and am running into mesh loading failures during import.

My setup

MuJoCo version tested: 3.6.0 and 3.3.7

API: MuJoCo Unity plugin

OS: Windows 11 Pro

Architecture: x64

Unity Editor version: 6000.3.9f1

What's happening? What did you expect?

When importing an MJCF model with mesh assets in the MuJoCo Unity importer, the import fails with:

IOException: Error loading the model: Error: no decoder found for mesh file '.../pelvis.STL'
Element name 'pelvis', id 0, line 20
Mujoco.MjEngineTool.LoadModelFromFile (...)
Mujoco.MjImporterWithAssets.ImportFile (...)
Mujoco.MjImporterEditorWindow.Apply ()

I expected the model to import successfully, or at least for supported mesh formats such as STL / OBJ to be recognized by the decoder system.

I tried the following:

  • MuJoCo 3.6.0
  • MuJoCo 3.3.7
  • original .STL meshes
  • converting the STL meshes to binary STL
  • converting meshes to .obj
  • using content_type="model/stl" and content_type="model/obj"

Steps for reproduction

Steps for reproduction

  1. Create a blank Unity project.
  2. Add the MuJoCo Unity package from a tagged MuJoCo repo checkout. I tried both 3.6.0 and 3.3.7.
  3. Copy the matching Windows mujoco.dll into C:\Users\YourName\MuJoCo as described in the docs.
  4. Open the MuJoCo importer in Unity.
  5. Clone the unitree_mujoco repo and try to import this MJCF file: https://github.com/unitreerobotics/unitree_mujoco/blob/main/unitree_robots/g1/g1_23dof.xml.
  6. Observe the import failure with no decoder found for mesh file.
  7. I also reproduced the same behavior after converting the referenced meshes to OBJ and updating the MJCF accordingly.

Minimal model for reproduction

Clone the unitree_mujoco repo and try using this xml file: https://github.com/unitreerobotics/unitree_mujoco/blob/main/unitree_robots/g1/g1_23dof.xml

unitree_mujoco-main.zip

Code required for reproduction

No custom code is needed beyond using the Unity importer UI.

The failure occurs when clicking import/apply in the MuJoCo Unity importer.

Confirmations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions