bindPhysicsMaterial#

Fully qualified name: usdex::core::bindPhysicsMaterial

bool usdex::core::bindPhysicsMaterial(
pxr::UsdPrim prim,
const pxr::UsdShadeMaterial &material,
)#

Binds a physics material to a given rigid body or collision geometry.

Validates both the prim and the material, applies the UsdShadeMaterialBindingAPI to the target prim, and binds the material to the target prim with the “physics” purpose.

Note

The material is bound with the “physics” purpose, and with the default “fallback strength”, meaning descendant prims can override with a different material. If alternate behavior is desired, use the UsdShadeMaterialBindingAPI directly.

Note

We cannot bind materials to prims across different instance boundaries. This function returns an error if prim are not placed in an editable location.

Parameters:
  • prim – The prim that the material will affect

  • material – The material to bind to the prim

Returns:

Whether the material was successfully bound to the target prim.