Isaac Sim Version
[*] 4.1.0
Operating System
[*] Ubuntu 22.04
GPU Information
- Model: GeForce RTX 4090
- Driver Version: 550.90.07
Topic Description
I am curious about the usage of PhysxCookedDataAPI in the doc PhysxSchemaPhysxCookedDataAPI Class Reference.
I find an example in the extsPhysics (the usda file path is isaac-sim-4.1.0/extsPhysics/omni.physx.tests.visual/data/DebugVisTestStages/debugvis.usda), from which some codes are like:
def Mesh "Cone" (
prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsCollisionAPI", "PhysicsMeshCollisionAPI", "PhysxCookedDataAPI:convexHull"]
)
{
uchar[] physxCookedData:convexHull:buffer = [9, 250, 126, 209, 216, ...]
}
I already know we can save the cooked data cache into the local disk. But I think this PhysxCookedDataAPI is more convenient, if it is available indeed, as we can transfer some usd with its cooked data cache to anyone that don’t share the same local disk cache.
So I first tried to write scripts as the following:
from isaacsim import SimulationApp
CONFIG = {"headless": True}
kit = SimulationApp(launch_config=CONFIG)
import omni.physx.bindings._physx as physx_bindings
kit.set_setting(physx_bindings.SETTING_SAVE_COOKED_DATA, True)
from pxr import PhysxSchema
# when setting collider to the prim
# the input param `token` such as PhysxSchema.Tokens.convexDecomposition
cooked_data_api = PhysxSchema.PhysxCookedDataAPI.Apply(prim, token)
cooked_data_api.CreateBufferAttr()
The key issue I am wondering is how to save the serialized cooked data buffer into the usd. Is it an automatic saving process after starting the simulation? Is there any docs in more detailed?