How to attach a PhysicalMaterial to a mesh

I have a mesh created with mesh = UsdGeom.Mesh.Define(stage, curPrimPath), and a physics material created with material = PhysicsMaterial(static_friction = 0.8, dynamic_friction = 0.8, restitution=0.0, prim_path=“/World/Physics_Materials/defaultMaterial”), how do I attach this material to the mesh I just created. Note I already made it a rigidbody with utils.setRigidBody(prim=mesh.GetPrim(), approximationShape=“convexHull”, kinematic=False) from omni.physx.scripts

Ok, this seems to work:
" stage = omni.usd.get_context().get_stage()
geometry_prim = GeometryPrim(curPrimPath, stage)
geometry_prim.apply_physics_material(pMat)
"

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.