[Warning] [omni.physx.plugin] Deprecated function, please use IPhysxCooking::requestConvexCollisionRepresentation interface instead

Can some please help me to avoid getting this warning:
[Warning] [omni.physx.plugin] Deprecated function, please use IPhysxCooking::requestConvexCollisionRepresentation interface instead.

I do something like this, which worked fine with Isaacsim 2023.1.1:

from omni.physx import get_physx_cooking_interface, get_physx_interface
for mesh_path in objects:
   num_convex_hulls = get_physx_cooking_interface().get_nb_convex_mesh_data(mesh_path)
   for hull_index in range(num_convex_hulls):
      convex_hull_data = get_physx_cooking_interface().get_convex_mesh_data(mesh_path, hull_index)

Now I get this warning >10000 times when I start a full training run.

yes you can switch your code to the new interface. Please open the physics demo (window->simulation->demos) ConvexMeshData, there if you check the python source code you would see how to use the new interface.

Should look like this:

        physx_cooking = get_physx_cooking_interface()
        stage_id = UsdUtils.StageCache.Get().GetId(self._stage).ToLongInt()
        prim_id = PhysicsSchemaTools.sdfPathToInt(convex_path)
        # Do a synchronous request for a convex representation
                                                              run_asynchronously=False,  # <-- Synchronous

    def on_convex_representation_ready(self, result: PhysxCollisionRepresentationResult, convexes: list[Any]):
        if result == PhysxCollisionRepresentationResult.RESULT_VALID:
            self._convexes = convexes

process the hulls:
        for convex_hull_data in convex_hulls:
            if len(convex_hull_data.polygons) > 0:
                indices = convex_hull_data.indices
                vertices = convex_hull_data.vertices
                polygons = convex_hull_data.polygons


Thank you!

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