Deformable Migration Guide#
This guide provides information on how to migrate from the removed deformable body and particle cloth schemas, APIs, helper functions, and tensor views to their replacements, and describes the limited support for automatically converting legacy USD assets.
Note
The deformable implementation is based on codeless USD schemas. See Deformable Bodies for examples on how to write code against codeless schemas in Python.
The volume and surface deformable feature set achieves near-complete feature parity with the removed deformable body and particle cloth features, with the following notable exceptions:
Particle cloth behavior can only be approximated using surface deformables, as the two systems are based on different underlying physical models. Particle cloth is implemented using a PBD mass-spring system, whereas surface deformables use an XPBD FEM corotational linear elasticity model.
The particle cloth aerodynamics model, which includes lift, drag, and wind parameters, is not supported by surface deformables.
Simulation of inflatables using particle cloth is not supported with surface deformables.
Kinematic volume deformables can only be animated by moving simulation mesh points. Animation through movement of graphical mesh points is no longer supported.
PhysX Deformable Body#
The current deformable implementation separates concerns, making the USD representation more explicit and flexible. Key points for migration:
Explicit representation of simulation, collision and graphical meshes as
UsdGeomprims.Hierarchical organization of deformable body, if multiple mesh geometries are required.
The rest shape is represented as attributes on the simulation mesh prim. Collision and render meshes have no rest shape.
Collision and render meshes are registered to the simulation mesh via bind poses.
Parameters for procedural generation of simulation and collision meshes are explicitly represented at the root prim of the deformable body.
Kinematic motion is supported for the simulation mesh only. Render-mesh–driven kinematics are not supported.
Note that the expression “deformable body” refers to “soft bodies” or “volume deformables” in the previous implementation, but in the current implementation refers to deformables, including surface deformable (or “cloth”), in general.
PhysxSchema#
PhysxDeformableAPI, PhysxDeformableBodyAPI defined in the PhysxSchema have been removed. They defined deformable simulation parameter attributes as well as attributes to define simulation and collision mesh data, all on the same graphical UsdGeom.Mesh prim that was skinned to the deformable motion when simulated. Parameters to control simulation and collision mesh generation were represented as custom attributes.
As described above, the deformable feature set represents a deformable body as a prim hierarchy employing the following USD schemas:
PhysxSchema.PhysxCollisionAPI
For an example setup, see Volume Deformable Hierarchy.
Further, the generation of simulation and collision meshes is now driven by:
For an example setup, see Auto Volume Deformable Hierarchy.
PhysxDeformableAPI:
physxDeformable:deformableEnabled→OmniPhysicsDeformableBodyAPI,omniphysics:deformableBodyEnabledphysxDeformable:simulationOwner→OmniPhysicsBodyAPI,omniphysics:simulationOwnerphysxDeformable:solverPositionIterationCount→PhysxBaseDeformableBodyAPI,physxDeformableBody:solverPositionIterationCountphysxDeformable:vertexVelocityDamping→PhysxBaseDeformableBodyAPI,physxDeformableBody:linearDampingphysxDeformable:sleepDamping→PhysxBaseDeformableBodyAPI,physxDeformableBody:settlingDampingphysxDeformable:sleepThreshold→PhysxBaseDeformableBodyAPI,physxDeformableBody:sleepThresholdphysxDeformable:settlingThreshold→PhysxBaseDeformableBodyAPI,physxDeformableBody:settlingThresholdphysxDeformable:maxDepenetrationVelocity→PhysxBaseDeformableBodyAPI,physxDeformableBody:maxDepenetrationVelocityphysxDeformable:selfCollision→PhysxBaseDeformableBodyAPI,physxDeformableBody:selfCollisionphysxDeformable:selfCollisionFilterDistance→PhysxBaseDeformableBodyAPI,physxDeformableBody:selfCollisionFilterDistancephysxDeformable:enableCCD→PhysxBaseDeformableBodyAPI,physxDeformableBody:enableSpeculativeCCDphysxDeformable:restPoints→ N/A - the original positions of the render mesh vertices are now implicitly defined by the simulation mesh positions and the bind pose (OmniPhysicsDeformablePoseAPIwithbindPosepurpose inomniphysics:purposesandomniphysics:points).physxDeformable:simulationVelocities→ SimulationUsdGeom.TetMeshwithOmniPhysicsVolumeDeformableSimAPI,velocitiesphysxDeformable:simulationIndices→ SimulationUsdGeom.TetMeshwithOmniPhysicsVolumeDeformableSimAPI,tetVertexIndices,omniphysics:restTetVtxIndices, both need to be set to the same indices currently.
PhysxDeformableBodyAPI:
physxDeformable:disableGravity→PhysxBaseDeformableBodyAPI,physxDeformableBody:disableGravityphysxDeformable:collisionIndices→ CollisionUsdGeom.TetMeshwithUsdPhysics.CollisionAPI,tetVertexIndicesphysxDeformable:collisionPoints→ CollisionUsdGeom.TetMeshwithUsdPhysics.CollisionAPI,pointsphysxDeformable:collisionRestPoints→ N/A - the original positions of the collision mesh vertices are now implicitly defined by the simulation mesh positions and the bind pose (OmniPhysicsDeformablePoseAPIwithbindPosepurpose inomniphysics:purposesandomniphysics:points).physxDeformable:simulationPoints→ SimulationUsdGeom.TetMeshwithOmniPhysicsVolumeDeformableSimAPI,pointsphysxDeformable:simulationRestPoints→OmniPhysicsVolumeDeformableSimAPI,omniphysics:restShapePoints
mass→OmniPhysicsDeformableBodyAPI,omniphysics:massdensity→ N/A - density can still be expressed through material.
PhysxSchema.PhysxCollisionAPI:
physxCollision:contactOffset,physxCollision:restOffset→ are now applied toUsdGeom.TetMeshwithUsdPhysics.CollisionAPI.
Custom Kinematic Attributes:
physxDeformable:kinematicEnabled→OmniPhysicsBodyAPI,omniphysics:kinematicEnabled. Note that the current implementation only supports kinematic driven motion on the simulation mesh. Render mesh driven kinematic motion is not supported.physxDeformable:collisionVertexToSimulationTetIndices→ N/AphysxDeformable:collisionVertexToSkinTriVertexIndices→ N/AphysxDeformable:collisionVertexToSkinTriBarycentrics→ N/A
Custom Attributes for Mesh Generation:
physxDeformable:simulationHexahedralResolution→PhysxAutoDeformableHexahedralMeshAPI,physxDeformableBody:resolutionphysxDeformable:collisionSimplification→PhysxAutoDeformableMeshSimplificationAPI,physxDeformableBody:autoDeformableMeshSimplificationEnabledphysxDeformable:collisionSimplificationResolution→PhysxAutoDeformableMeshSimplificationAPI,physxDeformableBody:remeshingEnabledphysxDeformable:collisionSimplificationRemeshingResolution→PhysxAutoDeformableMeshSimplificationAPI,physxDeformableBody:remeshingResolutionphysxDeformable:collisionSimplificationTargetTriangleCount→PhysxAutoDeformableMeshSimplificationAPI,physxDeformableBody:targetTriangleCountphysxDeformable:collisionSimplificationForceConforming→PhysxAutoDeformableMeshSimplificationAPI,physxDeformableBody:forceConforming
PhysxDeformableBodyMaterialAPI:
physxDeformableBodyMaterial:density→OmniPhysicsBaseMaterialAPI,omniphysics:densityphysxDeformableBodyMaterial:dynamicFriction→OmniPhysicsBaseMaterialAPI,omniphysics:dynamicFrictionphysxDeformableBodyMaterial:youngsModulus→OmniPhysicsDeformableMaterialAPI,omniphysics:youngsModulusphysxDeformableBodyMaterial:poissonsRatio→OmniPhysicsDeformableMaterialAPI,omniphysics:poissonsRatiophysxDeformableBodyMaterial:elasticityDamping→PhysxDeformableMaterialAPI,physxDeformableMaterial:elasticityDampingphysxDeformableBodyMaterial:dampingScale→ N/A
Deformable Utils#
The previous implementation offered functions in omni.physx.scripts.deformableUtils for setting up a deformable body. Setup exclusively through USD was theoretically possible, but involved configuration of non-documented custom attributes. The current implementation improves on this and should make a custom USD setup feasible. Helper functions still simplify the setup though.
omni.physx.scripts.deformableUtils:
add_physx_deformable_body→set_physics_volume_deformable_bodyfor single prim setups, andcreate_auto_volume_deformable_hierarchyfor hierarchical setups supporting the procedural generation of simulation and collision meshes.add_deformable_body_material→add_deformable_material
omni.physx.PhysXCooking:
cook_deformable_body_mesh→cook_auto_deformable_body, used to synchronously execute the generation of simulation and collision meshes.
Tensor API#
The following soft body tensor APIs have been removed:
SimulationView.create_soft_body_viewSimulationView.create_soft_body_material_viewSoftBodyViewSoftBodyMaterialView
Use the following APIs for volume deformable bodies instead:
SimulationView.create_volume_deformable_body_viewSimulationView.create_deformable_material_viewDeformableBodyViewDeformableMaterialView
When porting, the following should be considered:
An instance of
DeformableBodyViewcan either contain surface deformable bodies or volume deformable bodies but not both. It always refers to the root prims withOmniPhysicsDeformableBodyAPI.DeformableBodyView.simulation_mesh_prim_pathsprovides access to the corresponding simulation mesh prim paths. These will be identical toprim_pathsfor single prim volume deformable bodies, where the roots are identical to the simulation meshes.Similarly,
DeformableBodyView.collision_mesh_prim_pathsprovides access to the corresponding collision mesh prim paths, which may or may not be identical to the simulation mesh prim paths.For volume deformable bodies,
DeformableBodyView.num_nodes_per_elementwill always return 4, as a volume deformable simulation mesh consists of tetrahedra.
PhysX Particle Cloth#
The PhysX particle cloth feature, its Omni PhysX integration, and the related schemas have been removed. Cloth is replaced by the deformable implementation, which also supports surface deformables. The USD representation of surface deformables differs from that of volume deformables as follows:
The simulation mesh is represented as a
UsdGeom.Mesh, limited to triangle faces, withOmniPhysicsSurfaceDeformableSimAPI.The simulation mesh always doubles as the collision mesh.
Kinematic motion is currently not supported.
Note
While it should be possible to port soft bodies of the previous implementation to volume deformables, while maintaining the same behavior in most cases, the same is not true when porting particle cloth to surface deformables, as they don’t share the same underlying physical model. Particle cloth was implemented based on a PBD mass-spring system, while surface deformables are implemented based on a XPBD FEM corotational linear elasticity model.
How to set up a surface deformable is shown in Surface Deformable Hierarchy and Auto Surface Deformable Hierarchy.
PhysxSchema#
PhysxParticleClothAPI has been removed. The particle system schemas it depended on remain supported for non-cloth particle simulations:
PhysxSchema.PhysxParticleAPIPhysxSchema.PhysxParticleSystemPhysxSchema.PhysxPBDMaterialAPI
When cloth is migrated, all of the above should be replaced with the deformable system. They should be kept only if used for non-cloth particles.
PhysxSchema.PhysxParticleAPI:
physxParticle:particleEnabled→OmniPhysicsDeformableBodyAPI,omniphysics:deformableBodyEnabledphysxParticle:particleSystem→ N/AphysxParticle:selfCollision→PhysxBaseDeformableBodyAPI,physxDeformableBody:selfCollisionphysxParticle:particleGroup→ N/A - |UsdCollisionGroupAPI|_ and |UsdFilteredPairsAPI|_ can be used to configure collision filtering.
PhysxParticleClothAPI:
physxParticle:selfCollisionFilter→ N/A -PhysxBaseDeformableBodyAPI,physxDeformableBody:selfCollisionFilterDistancecan be used to configure the self collision filtering.physxParticle:restPoints→ N/A - the original positions of the render mesh vertices are now implicitly defined by the simulation mesh positions and the bind pose (OmniPhysicsDeformablePoseAPIwithbindPosepurpose inomniphysics:purposesandomniphysics:points).physxParticle:springIndices,physxParticle:springStiffnesses,physxParticle:springDampings,physxParticle:springRestLengths→ N/A - physical properties are defined through materials and the rest shape attributes of the simulation mesh.physxParticle:pressure→ N/A
PhysxAutoParticleClothAPI:
physxAutoParticleCloth:springBendStiffness→OmniPhysicsSurfaceDeformableMaterialAPI,omniphysics:surfaceBendStiffnessphysxAutoParticleCloth:springStretchStiffness,physxAutoParticleCloth:springShearStiffness→OmniPhysicsDeformableMaterialAPIandOmniPhysicsSurfaceDeformableMaterialAPI,omniphysics:surfaceThickness,omniphysics:youngsModulus,omniphysics:poissonsRatio-omniphysics:surfaceStretchStiffnessis currently not supportedphysxAutoParticleCloth:springDamping→PhysxDeformableMaterialAPI,physxDeformableMaterial:elasticityDampingphysxAutoParticleCloth:disableMeshWelding→ N/A
mass→OmniPhysicsDeformableBodyAPI,omniphysics:massdensity→ N/A - density can still be expressed through material.
PhysxSchema.PhysxParticleSystem:
particleSystemEnabled→OmniPhysicsDeformableBodyAPI,omniphysics:deformableBodyEnabledsimulationOwner→OmniPhysicsBodyAPI,omniphysics:simulationOwnercontactOffset→PhysxSchema.PhysxCollisionAPI,physxCollision:contactOffsetrestOffset→PhysxSchema.PhysxCollisionAPI,physxCollision:restOffsetparticleContactOffset→ N/AsolidRestOffset→ N/AfluidRestOffset→ N/AenableCCD→PhysxBaseDeformableBodyAPI,physxDeformableBody:enableSpeculativeCCDsolverPositionIterationCount→PhysxBaseDeformableBodyAPI,physxDeformableBody:solverPositionIterationCountmaxDepenetrationVelocity→PhysxBaseDeformableBodyAPI,physxDeformableBody:maxDepenetrationVelocitywind→ N/AmaxNeighborhood→ N/AneighborhoodScale→ N/AmaxVelocity→PhysxBaseDeformableBodyAPI,physxDeformableBody:maxLinearVelocityglobalSelfCollisionEnabled→ N/AnonParticleCollisionEnabled→ N/A
PhysxSchema.PhysxPBDMaterialAPI:
physxPBDMaterial:friction→OmniPhysicsBaseMaterialAPI,omniphysics:dynamicFrictionphysxPBDMaterial:particleFrictionScale→ N/AphysxPBDMaterial:damping→PhysxBaseDeformableBodyAPI,physxDeformableBody:linearDampingphysxPBDMaterial:viscosity→ N/AphysxPBDMaterial:vorticityConfinement→ N/AphysxPBDMaterial:surfaceTension→ N/AphysxPBDMaterial:cohesion→ N/AphysxPBDMaterial:adhesion→ N/AphysxPBDMaterial:particleAdhesionScale→ N/AphysxPBDMaterial:adhesionOffsetScale→ N/AphysxPBDMaterial:gravityScale→PhysxBaseDeformableBodyAPI,physxDeformableBody:disableGravityphysxPBDMaterial:lift,physxPBDMaterial:drag→ N/A - no support for aerodynamics, but simulation velocities can be manipulated directly.physxPBDMaterial:density→OmniPhysicsBaseMaterialAPI,omniphysics:densityphysxPBDMaterial:cflCoefficient→ N/A
Deformable Utils#
The previous implementation offered functions in omni.physx.scripts.particleUtils for setting up a particle cloth. Similar functionality can be found in omni.physx.scripts.deformableUtils for surface deformables.
omni.physx.scripts.particleUtils:
add_physx_particle_cloth→set_physics_surface_deformable_bodyfor single prim setups, andcreate_auto_surface_deformable_hierarchyfor hierarchical setups supporting the procedural generation of the simulation mesh.add_physx_particle_cloth_with_constraints→ N/Aadd_pbd_particle_material→add_deformable_material
Tensor API#
The following particle cloth tensor APIs have been removed:
SimulationView.create_particle_system_viewSimulationView.create_particle_cloth_viewSimulationView.create_particle_material_viewParticleSystemViewParticleClothViewParticleMaterialView
Use the following APIs for surface deformable bodies instead:
SimulationView.create_surface_deformable_body_viewSimulationView.create_deformable_material_viewDeformableBodyViewDeformableMaterialView
When porting, the following should be considered:
An instance of
DeformableBodyViewcan either contain surface deformable bodies or volume deformable bodies but not both. It always refers to the root prims withOmniPhysicsDeformableBodyAPI.DeformableBodyView.simulation_mesh_prim_pathsprovides access to the corresponding simulation mesh prim paths. These will be identical toprim_pathsfor single prim surface deformable bodies, where the roots are identical to the simulation meshes.For surface deformable bodies,
DeformableBodyView.collision_mesh_prim_pathswill always return the same paths assimulation_mesh_prim_paths.For surface deformable bodies,
DeformableBodyView.num_nodes_per_elementwill always return 3, as a surface deformable simulation mesh consists of triangle faces.An instance of
DeformableMaterialViewmay contain bothOmniPhysicsDeformableMaterialAPIandOmniPhysicsSurfaceDeformableMaterialAPIprims, however, currently onlyOmniPhysicsDeformableMaterialAPIattributes can be accessed.
PhysX Attachments#
The previous attachment schemas (PhysxSchema.PhysxAutoAttachmentAPI, PhysxSchema.PhysxPhysicsAttachment) have been removed. The current attachment feature is different in the following ways:
Generation of attachments and filters are now represented as a high-level attachment schema API that links
deformable root prim with
OmniPhysicsDeformableBodyAPIand another deformable root primdeformable root prim with
OmniPhysicsDeformableBodyAPIand aUsdGeom.Xformable(for example a prim withUsdPhysics.CollisionAPI)
Poisson sampling based attachment points along rigid surfaces are currently not supported.
High-level attachments between deformable bodies or deformable bodies and xformable prims are implemented with low-level attachment and element collision filter schema types. This migration guide, however, focuses on high-level attachments.
See Attachments and Collision Filters for examples on how to set up low-level or high-level attachments.
PhysxSchema#
PhysxSchema.PhysxAutoAttachmentAPI, used for creating attachments based on geometric overlap, has been removed and replaced by PhysxAutoDeformableAttachmentAPI. PhysxSchema.PhysxPhysicsAttachment has been removed and replaced by multiple schema subtypes of OmniPhysicsAttachment and OmniPhysicsElementCollisionFilter.
PhysxSchema.PhysxAutoAttachmentAPI:
physxAutoAttachment:enableDeformableVertexAttachments→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:enableDeformableVertexAttachmentsphysxAutoAttachment:deformableVertexOverlapOffset→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:deformableVertexOverlapOffsetphysxAutoAttachment:enableRigidSurfaceAttachments→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:enableRigidSurfaceAttachmentsphysxAutoAttachment:rigidSurfaceSamplingDistance→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:rigidSurfaceSamplingDistancephysxAutoAttachment:enableCollisionFiltering→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:enableCollisionFilteringphysxAutoAttachment:collisionFilteringOffset→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:collisionFilteringOffsetphysxAutoAttachment:enableDeformableFilteringPairs→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:enableDeformableFilteringPairs
PhysxSchema.PhysxPhysicsAttachment:
attachmentEnabled→ N/A - but can be expressed through low-levelOmniPhysicsAttachment,attachmentEnabledandOmniPhysicsElementCollisionFilter,filterEnabledactor0,actor1→PhysxAutoDeformableAttachmentAPI,physxAutoDeformableAttachment:attachable0,physxAutoDeformableAttachment:attachable1(referring to deformable root prims withOmniPhysicsDeformableBodyAPIorUsdGeom.Xformableprims)
Other attributes are automatically generated when using PhysxAutoDeformableAttachmentAPI.
Deformable Utils#
There are no utils for the legacy attachment feature. The current implementation offers omni.physx.scripts.deformableUtils.create_auto_deformable_attachment for setting up attachments, see Attaching a Volume Deformable to a Collider and Attaching a Surface Deformable to an Xformable for examples.
USD Asset Conversion#
Legacy USD assets that still use the removed deformable schemas can be converted using the Asset Validator feature in Omniverse. The UI for deformable feature conversion is described here.
The following types and API schemas have been removed; existing USD assets using them can be converted:
PhysxParticleClothAPI
PhysxParticleSystem prims are not removed. Need to be manually removed if not required anymore.
PhysxPBDMaterialAPI is not removed. Need to be manually removed if not required anymore.
PhysxDeformableBodyAPI
PhysxDeformableBodyMaterialAPI
PhysxDeformableSurfaceAPI (never officially supported)
PhysxDeformableSurfaceMaterialAPI (never officially supported)
PhysxPhysicsAttachment
Attachments between particle cloths and colliders/rigid bodies/world are converted.
Attachments between deformable bodies and colliders/rigid bodies/world are converted.
Attachments between deformable bodies and deformable bodies are not converted.
Attachments between particle cloths and deformable bodies are not converted.
TetrahedralMesh
Schema APIs supporting particle cloth, deformable body and attachment authoring are not supported by the converter. It is therefore recommended to recreate deformable assets for the current schemas. However, the conversion may serve as a quick reference or starting point.
The following API schemas and custom attributes supporting authoring of the removed features are not supported by the converter and will be ignored:
PhysxAutoParticleClothAPI
physxParticle:weldedTriangleIndices
physxParticle:weldedVerticesRemapToWeld
physxParticle:weldedVerticesRemapToOrig
physxParticle:inflatableVolume
physxDeformable:collisionSimplification
physxDeformable:collisionSimplificationRemeshing
physxDeformable:collisionSimplificationRemeshingResolution
physxDeformable:collisionSimplificationTargetTriangleCount
physxDeformable:collisionSimplificationForceConforming
physxDeformable:simulationHexahedralResolution
physxDeformable:numberOfTetsPerHex
physxDeformable:collisionVertexToSimulationTetIndices
physxDeformable:collisionVertexToSkinTriVertexIndices
physxDeformable:collisionVertexToSkinTriBarycentrics
physxDeformable:invMassScale