Deformable Migration Guide#

This guide provides information on how to migrate deprecated deformable body or particle cloth schema code, helper functions in omni.physx.scripts.deformableUtils, and describes the limited support for automatically upgrading deprecated USD assets.

Note

The new deformable implementation is based on codeless USD schemas. See Deformable Bodies (Beta) for examples on how to write code against codeless schemas in Python.

PhysX Deformable Body#

The new 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 UsdGeom prims.

  • 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 deprecated implementation, but in the new implementation refers to deformables, including surface deformable (or “cloth”), in general.

PhysxSchema#

PhysxSchema.PhysxDeformableAPI, PhysxSchema.PhysxDeformableBodyAPI defined in the PhysxSchema are deprecated. They define deformable simulation parameter attributes as well as attributes to define simulation and collision mesh data, all on the same graphical UsdGeom.Mesh prim that is skinned to the deformable motion when simulated. Parameters to control simulation and collision mesh generation are represented as custom attributes.

As described above, the new deformable feature set represents a deformable body as a prim hierarchy employing the following USD schemas:

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.

PhysxSchema.PhysxDeformableAPI:

PhysxSchema.PhysxDeformableBodyAPI:

UsdPhysics.MassAPI:

PhysxSchema.PhysxCollisionAPI:

Custom Kinematic Attributes:

  • physxDeformable:kinematicEnabledOmniPhysicsBodyAPI, omniphysics:kinematicEnabled. Note that the new schema implementation only supports kinematic driven motion on the simulation mesh. Render mesh driven kinematic motion is not supported.

  • physxDeformable:collisionVertexToSimulationTetIndices → N/A

  • physxDeformable:collisionVertexToSkinTriVertexIndices → N/A

  • physxDeformable:collisionVertexToSkinTriBarycentrics → N/A

Custom Attributes for Mesh Generation:

PhysxSchema.PhysxDeformableBodyMaterialAPI:

Deformable Utils#

The deprecated implementation offers functions in omni.physx.scripts.deformableUtils for setting up a deformable body. Setup exclusively through USD is theoretically possible, but involves configuration of non-documented custom attributes. The new 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_bodyset_physics_volume_deformable_body for single prim setups, and create_auto_volume_deformable_hierarchy for hierarchical setups supporting the procedural generation of simulation and collision meshes.

  • add_deformable_body_materialadd_deformable_material

omni.physx.PhysXCooking:

  • cook_deformable_body_meshcook_auto_deformable_body, used to synchronously execute the generation of simulation and collision meshes.

Tensor API#

Soft body APIs in Omni Physics Tensors are deprecated:

These APIs should all be replaced with the following APIs supporting the new volume deformable bodies:

When porting to the new APIs, the following should be considered:

PhysX Particle Cloth#

The PhysX particle cloth feature, its Omni Physx integration, and the related schema are deprecated. Cloth is replaced by the new deformable implementation, which also supports surface deformables. The USD representation of surface deformables differs from that of volume deformables as follows:

Note

While it should be possible to port soft bodies of the deprecated implementation to the new 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 is 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#

PhysxSchema.PhysxParticleClothAPI is deprecated. The particle system schemas it depended on remain supported for non-cloth particle simulations:

When cloth is migrated, all of the above should be replaced with the new deformable system. They should be kept only if used for non-cloth particles.

PhysxSchema.PhysxParticleAPI:

PhysxSchema.PhysxParticleClothAPI:

  • physxParticle:selfCollisionFilter → N/A - PhysxBaseDeformableBodyAPI, physxDeformableBody:selfCollisionFilterDistance can be used to configure the self collision filtering.

  • physxParticle:restPoints → N/A - the deprecated restPoints specify the original positions of the render mesh vertices, which are assumed to be implicitly defined by the original positions of the simulation mesh and the bind pose (OmniPhysicsDeformablePoseAPI with bindPose purpose in omniphysics:purposes and omniphysics:points) of the simulation mesh and the render mesh.

  • 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

PhysxSchema.PhysxAutoParticleClothAPI:

UsdPhysics.MassAPI:

PhysxSchema.PhysxParticleSystem:

PhysxSchema.PhysxPBDMaterialAPI:

  • physxPBDMaterial:frictionOmniPhysicsBaseMaterialAPI, omniphysics:dynamicFriction

  • physxPBDMaterial:particleFrictionScale → N/A

  • physxPBDMaterial:dampingPhysxBaseDeformableBodyAPI, physxDeformableBody:linearDamping

  • physxPBDMaterial:viscosity → N/A

  • physxPBDMaterial:vorticityConfinement → N/A

  • physxPBDMaterial:surfaceTension → N/A

  • physxPBDMaterial:cohesion → N/A

  • physxPBDMaterial:adhesion → N/A

  • physxPBDMaterial:particleAdhesionScale → N/A

  • physxPBDMaterial:adhesionOffsetScale → N/A

  • physxPBDMaterial:gravityScalePhysxBaseDeformableBodyAPI, physxDeformableBody:disableGravity

  • physxPBDMaterial:lift, physxPBDMaterial:drag → N/A - no support for aerodynamics, but simulation velocities can be manipulated directly.

  • physxPBDMaterial:densityOmniPhysicsBaseMaterialAPI, omniphysics:density

  • physxPBDMaterial:cflCoefficient → N/A

Deformable Utils#

The deprecated implementation offers 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_clothset_physics_surface_deformable_body for single prim setups, and create_auto_surface_deformable_hierarchy for hierarchical setups supporting the procedural generation of the simulation mesh.

  • add_physx_particle_cloth_with_constraints → N/A

  • add_pbd_particle_materialadd_deformable_material

Tensor API#

Particle cloth APIs in Omni Physics Tensors are deprecated:

These APIs exclusively support particle cloth and should all be replaced with the following APIs supporting surface deformable bodies:

When porting to the new APIs, the following should be considered:

PhysX Attachments#

The new attachment feature is different from the deprecated one in the following ways:

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 replaced by PhysxAutoDeformableAttachmentAPI. PhysxSchema.PhysxPhysicsAttachment has been replaced by multiple schema subtypes of OmniPhysicsAttachment and OmniPhysicsElementCollisionFilter.

PhysxSchema.PhysxAutoAttachmentAPI:

PhysxSchema.PhysxPhysicsAttachment:

Other attributes are automatically generated when using PhysxAutoDeformableAttachmentAPI.

Deformable Utils#

There are no utils for the legacy attachment feature. The new 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#

Deprecated 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 are deprecated and 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 currently not supported. It is therefore recommended to recreate deformable assets for the new schemas. However, the conversion may serve as quick workaround, reference or starting point.

The following API schemas and custom attributes supporting authoring of the deprecated features are currently not supported 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