diff --git a/doc/includes/references.h b/doc/includes/references.h index c9549e69..b1b5be9c 100644 --- a/doc/includes/references.h +++ b/doc/includes/references.h @@ -1046,7 +1046,6 @@ struct mjModel_ { int* mesh_graphadr; // graph data address; -1: no graph (nmesh x 1) mjtNum* mesh_pos; // translation applied to asset vertices (nmesh x 3) mjtNum* mesh_quat; // rotation applied to asset vertices (nmesh x 4) - int* mesh_assetpathadr; // address of asset path for mesh; -1: none (nmesh x 1) float* mesh_vert; // vertex positions for all meshes (nmeshvert x 3) float* mesh_normal; // normals for all meshes (nmeshnormal x 3) float* mesh_texcoord; // vertex texcoords for all meshes (nmeshtexcoord x 2) @@ -1054,6 +1053,7 @@ struct mjModel_ { int* mesh_facenormal; // normal face data (nmeshface x 3) int* mesh_facetexcoord; // texture face data (nmeshface x 3) int* mesh_graph; // convex graph data (nmeshgraph x 1) + int* mesh_pathadr; // address of asset path for mesh; -1: none (nmesh x 1) // skins int* skin_matid; // skin material id; -1: none (nskin x 1) @@ -2068,7 +2068,7 @@ struct mjvSceneState_ { int* mesh_bvhnum; int* mesh_texcoordadr; int* mesh_graphadr; - int* mesh_assetpathadr; + int* mesh_pathadr; int* skin_matid; int* skin_group; diff --git a/include/mujoco/mjmodel.h b/include/mujoco/mjmodel.h index 1e9cdea3..3535f95f 100644 --- a/include/mujoco/mjmodel.h +++ b/include/mujoco/mjmodel.h @@ -778,7 +778,6 @@ struct mjModel_ { int* mesh_graphadr; // graph data address; -1: no graph (nmesh x 1) mjtNum* mesh_pos; // translation applied to asset vertices (nmesh x 3) mjtNum* mesh_quat; // rotation applied to asset vertices (nmesh x 4) - int* mesh_assetpathadr; // address of asset path for mesh; -1: none (nmesh x 1) float* mesh_vert; // vertex positions for all meshes (nmeshvert x 3) float* mesh_normal; // normals for all meshes (nmeshnormal x 3) float* mesh_texcoord; // vertex texcoords for all meshes (nmeshtexcoord x 2) @@ -786,6 +785,7 @@ struct mjModel_ { int* mesh_facenormal; // normal face data (nmeshface x 3) int* mesh_facetexcoord; // texture face data (nmeshface x 3) int* mesh_graph; // convex graph data (nmeshgraph x 1) + int* mesh_pathadr; // address of asset path for mesh; -1: none (nmesh x 1) // skins int* skin_matid; // skin material id; -1: none (nskin x 1) diff --git a/include/mujoco/mjvisualize.h b/include/mujoco/mjvisualize.h index 527a1f2b..a8fada4c 100644 --- a/include/mujoco/mjvisualize.h +++ b/include/mujoco/mjvisualize.h @@ -469,7 +469,7 @@ struct mjvSceneState_ { int* mesh_bvhnum; int* mesh_texcoordadr; int* mesh_graphadr; - int* mesh_assetpathadr; + int* mesh_pathadr; int* skin_matid; int* skin_group; diff --git a/include/mujoco/mjxmacro.h b/include/mujoco/mjxmacro.h index aba80032..77276dd8 100644 --- a/include/mujoco/mjxmacro.h +++ b/include/mujoco/mjxmacro.h @@ -299,7 +299,6 @@ XMJV( int, mesh_graphadr, nmesh, 1 ) \ X ( mjtNum, mesh_pos, nmesh, 3 ) \ X ( mjtNum, mesh_quat, nmesh, 4 ) \ - XMJV( int, mesh_assetpathadr, nmesh, 1 ) \ X ( float, mesh_vert, nmeshvert, 3 ) \ X ( float, mesh_normal, nmeshnormal, 3 ) \ X ( float, mesh_texcoord, nmeshtexcoord, 2 ) \ @@ -307,6 +306,7 @@ X ( int, mesh_facenormal, nmeshface, 3 ) \ X ( int, mesh_facetexcoord, nmeshface, 3 ) \ X ( int, mesh_graph, nmeshgraph, 1 ) \ + XMJV( int, mesh_pathadr, nmesh, 1 ) \ XMJV( int, skin_matid, nskin, 1 ) \ XMJV( int, skin_group, nskin, 1 ) \ XMJV( float, skin_rgba, nskin, 4 ) \ diff --git a/introspect/structs.py b/introspect/structs.py index 063e6cc3..677704ca 100644 --- a/introspect/structs.py +++ b/introspect/structs.py @@ -2123,13 +2123,6 @@ STRUCTS: Mapping[str, StructDecl] = dict([ ), doc='rotation applied to asset vertices (nmesh x 4)', ), - StructFieldDecl( - name='mesh_assetpathadr', - type=PointerType( - inner_type=ValueType(name='int'), - ), - doc='address of asset path for mesh; -1: none (nmesh x 1)', - ), StructFieldDecl( name='mesh_vert', type=PointerType( @@ -2179,6 +2172,13 @@ STRUCTS: Mapping[str, StructDecl] = dict([ ), doc='convex graph data (nmeshgraph x 1)', # pylint: disable=line-too-long ), + StructFieldDecl( + name='mesh_pathadr', + type=PointerType( + inner_type=ValueType(name='int'), + ), + doc='address of asset path for mesh; -1: none (nmesh x 1)', + ), StructFieldDecl( name='skin_matid', type=PointerType( @@ -5977,7 +5977,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([ doc='', ), StructFieldDecl( - name='mesh_assetpathadr', + name='mesh_pathadr', type=PointerType( inner_type=ValueType(name='int'), ), diff --git a/src/engine/engine_io.c b/src/engine/engine_io.c index 754ab5cc..ee479005 100644 --- a/src/engine/engine_io.c +++ b/src/engine/engine_io.c @@ -1867,7 +1867,7 @@ const char* mj_validateReferences(const mjModel* m) { X(name_textadr, ntext, nnames , 0 ) \ X(name_tupleadr, ntuple, nnames , 0 ) \ X(name_keyadr, nkey, nnames , 0 ) \ - X(mesh_assetpathadr, nmesh, npaths , 0 ) + X(mesh_pathadr, nmesh, npaths , 0 ) #define X(adrarray, nadrs, ntarget, numarray) { \ int *nums = (numarray); \ diff --git a/src/user/user_model.cc b/src/user/user_model.cc index a6904257..5312e9cb 100644 --- a/src/user/user_model.cc +++ b/src/user/user_model.cc @@ -1332,10 +1332,10 @@ void mjCModel::CopyPaths(mjModel* m) { for (unsigned int i=0; ifile().empty()) { - m->mesh_assetpathadr[i] = -1; + m->mesh_pathadr[i] = -1; continue; } - m->mesh_assetpathadr[i] = adr; + m->mesh_pathadr[i] = adr; // copy path size_t path_size = meshes[i]->file().size(); diff --git a/test/user/user_mesh_test.cc b/test/user/user_mesh_test.cc index 418f71c0..c218e0c5 100644 --- a/test/user/user_mesh_test.cc +++ b/test/user/user_mesh_test.cc @@ -377,7 +377,7 @@ TEST_F(MjCMeshTest, SaveMeshOnce) { mjModel* model = mj_loadXML(xml_path.c_str(), 0, error.data(), error.size()); // Confirm the mesh file is loaded and stored in paths EXPECT_EQ( - std::string(&model->paths[model->mesh_assetpathadr[0]]), "cube.obj"); + std::string(&model->paths[model->mesh_pathadr[0]]), "cube.obj"); std::string saved_xml = SaveAndReadXml(model); EXPECT_THAT(saved_xml, Not(testing::HasSubstr("vertex"))); mj_deleteModel(model); diff --git a/unity/Runtime/Bindings/MjBindings.cs b/unity/Runtime/Bindings/MjBindings.cs index 0f299097..0266a05f 100644 --- a/unity/Runtime/Bindings/MjBindings.cs +++ b/unity/Runtime/Bindings/MjBindings.cs @@ -5250,7 +5250,6 @@ public unsafe struct mjModel_ { public int* mesh_graphadr; public double* mesh_pos; public double* mesh_quat; - public int* mesh_assetpathadr; public float* mesh_vert; public float* mesh_normal; public float* mesh_texcoord; @@ -5258,6 +5257,7 @@ public unsafe struct mjModel_ { public int* mesh_facenormal; public int* mesh_facetexcoord; public int* mesh_graph; + public int* mesh_pathadr; public int* skin_matid; public int* skin_group; public float* skin_rgba; @@ -6006,7 +6006,7 @@ public unsafe struct model { public int* mesh_bvhnum; public int* mesh_texcoordadr; public int* mesh_graphadr; - public int* mesh_assetpathadr; + public int* mesh_pathadr; public int* skin_matid; public int* skin_group; public float* skin_rgba;