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
get_physx_interface().force_load_physics_from_usd()
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.
Hi,
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
physx_cooking.request_convex_collision_representation(stage_id=stage_id,
collision_prim_id=prim_id,
run_asynchronously=False, # <-- Synchronous
on_result=self.on_convex_representation_ready)
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