@@ -127,17 +127,18 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
127127 tile_beg = tile_corners [i ]
128128 tile_end = mjm .nv if i == len (tile_corners ) - 1 else tile_corners [i + 1 ]
129129 tiles .setdefault (tile_end - tile_beg , []).append (tile_beg )
130+
130131 qM_tiles = tuple (types .TileSet (adr = wp .array (tiles [sz ], dtype = int ), size = sz ) for sz in sorted (tiles .keys ()))
131132
132- # subtree_mass is a precalculated arrya used in smooth
133+ # subtree_mass is a precalculated array used in smooth
133134 subtree_mass = np .copy (mjm .body_mass )
134135 # TODO(team): should this be [mjm.nbody - 1, 0) ?
135136 for i in range (mjm .nbody - 1 , - 1 , - 1 ):
136137 subtree_mass [mjm .body_parentid [i ]] += subtree_mass [i ]
137138
138139 # actuator_moment tiles are grouped by dof size and number of actuators
139- tree_id = mjm . dof_treeid [ tile_corners ]
140- num_trees = int (np .max (tree_id ))
140+ tree_id = np . arange ( len ( tile_corners ), dtype = np . int32 )
141+ num_trees = int (np .max (tree_id )) if len ( tree_id ) > 0 else 0
141142 bodyid = []
142143 for i in range (mjm .nu ):
143144 trntype = mjm .actuator_trntype [i ]
@@ -250,7 +251,7 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
250251 nxn_geom_pair .append ((geom1 , geom2 ))
251252 nxn_pairid .append (pairid )
252253
253- return types .Model (
254+ m = types .Model (
254255 nq = mjm .nq ,
255256 nv = mjm .nv ,
256257 nu = mjm .nu ,
@@ -270,6 +271,8 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
270271 nwrap = mjm .nwrap ,
271272 nsensor = mjm .nsensor ,
272273 nsensordata = mjm .nsensordata ,
274+ nmeshvert = mjm .nmeshvert ,
275+ nmeshface = mjm .nmeshface ,
273276 nlsp = nlsp ,
274277 npair = mjm .npair ,
275278 opt = types .Option (
@@ -375,6 +378,8 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
375378 geom_condim = wp .array (mjm .geom_condim , dtype = int ),
376379 geom_bodyid = wp .array (mjm .geom_bodyid , dtype = int ),
377380 geom_dataid = wp .array (mjm .geom_dataid , dtype = int ),
381+ geom_group = wp .array (mjm .geom_group , dtype = int ),
382+ geom_matid = wp .array (mjm .geom_matid , dtype = int ),
378383 geom_priority = wp .array (mjm .geom_priority , dtype = int ),
379384 geom_solmix = wp .array (mjm .geom_solmix , dtype = float ),
380385 geom_solref = wp .array (mjm .geom_solref , dtype = wp .vec2 ),
@@ -387,6 +392,7 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
387392 geom_friction = wp .array (mjm .geom_friction , dtype = wp .vec3 ),
388393 geom_margin = wp .array (mjm .geom_margin , dtype = float ),
389394 geom_gap = wp .array (mjm .geom_gap , dtype = float ),
395+ geom_rgba = wp .array (mjm .geom_rgba , dtype = wp .vec4 ),
390396 site_bodyid = wp .array (mjm .site_bodyid , dtype = int ),
391397 site_pos = wp .array (mjm .site_pos , dtype = wp .vec3 ),
392398 site_quat = wp .array (mjm .site_quat , dtype = wp .quat ),
@@ -411,6 +417,8 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
411417 mesh_vertadr = wp .array (mjm .mesh_vertadr , dtype = int ),
412418 mesh_vertnum = wp .array (mjm .mesh_vertnum , dtype = int ),
413419 mesh_vert = wp .array (mjm .mesh_vert , dtype = wp .vec3 ),
420+ mesh_faceadr = wp .array (mjm .mesh_faceadr , dtype = int ),
421+ mesh_face = wp .array (mjm .mesh_face , dtype = wp .vec3i ),
414422 eq_type = wp .array (mjm .eq_type , dtype = int ),
415423 eq_obj1id = wp .array (mjm .eq_obj1id , dtype = int ),
416424 eq_obj2id = wp .array (mjm .eq_obj2id , dtype = int ),
@@ -517,8 +525,11 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
517525 mujoco .mjtSensor .mjSENS_FRAMEANGACC ,
518526 ],
519527 ).any (),
528+ mat_rgba = wp .array (mjm .mat_rgba , dtype = wp .vec4 ),
520529 )
521530
531+ return m
532+
522533
523534def make_data (mjm : mujoco .MjModel , nworld : int = 1 , nconmax : int = - 1 , njmax : int = - 1 ) -> types .Data :
524535 # TODO(team): move to Model?
0 commit comments