Hi,
I am trying to procedurally generate meshes and add them to IsaacSim. Is there a way to programmatically do this? Note that I don’t need the asset to be in an instanceable format. I tried to use the following piece of code
mesh_data = ProcMesh(cfg)
stage = get_current_stage()
mesh = stage.DefinePrim("/World/proc_mesh", "Mesh")
mesh.GetAttribute("points").Set(mesh_data.vertices)
mesh.GetAttribute("faceVertexIndices").Set(mesh_data.triangles.flatten())
mesh.GetAttribute("faceVertexCounts").Set(np.asarray([3] * mesh_data.triangles.shape[1]))
mesh_prim = XFormPrim(prim_path="/World/proc_mesh",
name="proc_mesh",
position=None,
orientation=None)
UsdPhysics.CollisionAPI.Apply(mesh_prim.prim)
physx_collision_api = PhysxSchema.PhysxCollisionAPI.Apply(mesh_prim.prim)
physx_collision_api.GetContactOffsetAttr().Set(0.02)
physx_collision_api.GetRestOffsetAttr().Set(0.00)
This runs without errors. However, I don’t see the corresponding mesh in the viewer when it launches. Note that I do see that a mesh exists in the scene hierarchy panel, but it does not appear in the viewer and other objects do not collide with it.
Is there some additional step required to make this work?