Python API#
- omni.physx.scripts.utils.get_spatial_tendon_attachment_candidates(
- prim: Prim,
Returns a list of PhysxTendonAttachment(Root)API instance names on the provided prim that are candidates for creating a parent relationship to. Notably, this list will exclude leaf attachments that are not suitable targets for a parent relationship.
- Parameters:
prim – the Usd.Prim to parse for suitable attachment candidates
- Returns:
A str list of attachment instance names
- omni.physx.scripts.utils.safe_import_tests(source_module_name, submodules_list=None)#
Tries to import tests if the tests ext is present. The tests ext is expected to be loaded as follows:
1) use when the tests need to be visible in the test runner UI and the tests ext needs to be explicitly loaded by another ext or is included in the kit file
[dependencies] “omni.physx.tests” = {optional=true}
2) this will include the dependency only when running tests in the separate kit process, like when run using the generated batch files and the tests would then likely not be visible in the test runner UI
[[test]] dependencies = [“omni.physx.tests”]
- omni.physx.scripts.physicsUtils.add_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Capsule to the stage.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Capsule to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cone to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cylinder to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collider_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Sphere to the stage and add physics collider API to it.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_collision_to_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Add collision path to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.add_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cone to the stage.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cube to the stage.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cube_ground_plane(
- stage: Stage,
- cubePath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add UsdGeom.Cube to the stage to act as a sized plane with thickness. The cube is scaled by a vector Gf.Vec3f(0.01, 1.0, 1.0) depending on the up Axis
- Parameters:
stage – The Usd.Stage to add path.
cubePath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Cylinder to the stage.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_density(
- stage: Stage,
- path: str | Path,
- value: float,
Add density to given prim. Note that his will apply MassAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
value – The desired density.
- omni.physx.scripts.physicsUtils.add_force_torque(
- stage: Stage,
- path: str | Path,
- force: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- torque: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- mode: str = 'acceleration',
- isEnabled: bool = True,
- isWorldSpace: bool = False,
Add force/torque to given prim. Note that his will apply PhysxForceAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
force – The desired force.
torque – The desired torque.
mode – The force/torque mode.
isEnabled – Bool defining whether force is enabled or not.
isWorldSpace – Bool defining whether force is applied in world space or body local space.
- omni.physx.scripts.physicsUtils.add_ground_plane(
- stage: Stage,
- planePath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add ground plane to the stage. Note that it will add a mesh for rendering purpose and UsdPhysics.Plane for collision purpose.
- Parameters:
stage – The Usd.Stage to add path.
planePath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_joint_fixed(
- stage: Stage,
- jointPath: str | Path,
- actor0: str | Path,
- actor1: str | Path,
- localPos0: Vec3f,
- localRot0: Quatf,
- localPos1: Vec3f,
- localRot1: Quatf,
- breakForce: float,
- breakTorque: float,
Add fixed joint to the stage.
- Parameters:
stage – The Usd.Stage to add the joint.
jointPath – The desired joint path.
actor0 – The actor0 for the joint.
actor1 – The actor1 for the joint.
localPos0 – The joint local position offset from the actor0
localRot0 – The joint local rotation offset from the actor0
localPos1 – The joint local position offset from the actor1
localRot1 – The joint local rotation offset from the actor1
breakForce – The joint break force.
breakTorque – The joint break torque.
- omni.physx.scripts.physicsUtils.add_mass(
- stage: Stage,
- path: str | Path,
- mass: float = 1.0,
Add mass to given prim. Note that his will apply MassAPI on the prim.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
value – The desired mass.
- omni.physx.scripts.physicsUtils.add_physics_material_to_prim(
- stage: Stage,
- prim: Prim,
- materialPath: str | Path,
Bind physics material to a given prim.
- Parameters:
stage – The Usd.Stage to add path.
prim – The Usd.Prim where material should have the binding to.
materialPath – The path of the material.
- omni.physx.scripts.physicsUtils.add_quad_plane(
- stage: Stage,
- quadPath: str | Path,
- axis: str,
- size: float,
- position: Vec3f | Vec3d,
- color: Vec3f,
Add quad mesh to the stage to act as a sized plane.
- Parameters:
stage – The Usd.Stage to add path.
quadPath – The desired ground plane path.
axis – The up axis - “Y”, “Z”
size – The half size of the mesh.
position – The position where the mesh should be placed in stage.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_rigid_box(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cube to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_capsule(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Capsule to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add capsule.
path – The desired capsule path.
radius – The radius of the capsule.
height – The height of the capsule.
axis – The axis of the capsule.
position – The position where the capsule should be placed in stage.
orientation – The capsule orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cone(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cone to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired cone path.
radius – The radius of the cone.
height – The height of the cone.
axis – The axis of the cone.
position – The position where the cone should be placed in stage.
orientation – The cone orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cube(
- stage: Stage,
- path: str | Path,
- size: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cube to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cube.
path – The desired cube path.
size – The size of the cube.
position – The position where the cube should be placed in stage.
orientation – The cube orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_cylinder(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- height: float = 1.0,
- axis: str = 'Y',
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Cylinder to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add cylinder.
path – The desired cylinder path.
radius – The radius of the cylinder.
height – The height of the cylinder.
axis – The axis of the cylinder.
position – The position where the cylinder should be placed in stage.
orientation – The cylinder orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
- density: float = 1.0,
- lin_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- ang_velocity: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
Add UsdGeom.Sphere to the stage and add physics rigid body and collider API to it.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
lin_velocity – The initial linear velocity of the rigid body.
ang_velocity – The initial angular velocity of the rigid body.
- omni.physx.scripts.physicsUtils.add_rigid_xform(
- stage: Stage,
- path: str | Path,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- scale: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add xform to the stage with given transformation and add rigid body API to it.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired xform path.
position – The position where the xform should be placed in stage.
orientation – The xform orientation.
scale – The xform scale.
- omni.physx.scripts.physicsUtils.add_sphere(
- stage: Stage,
- path: str | Path,
- radius: float = 1.0,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- color: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add UsdGeom.Sphere to the stage.
- Parameters:
stage – The Usd.Stage to add sphere.
path – The desired sphere path.
radius – The radius of the sphere.
position – The position where the sphere should be placed in stage.
orientation – The sphere orientation.
color – The color of the mesh.
- omni.physx.scripts.physicsUtils.add_xform(
- stage: Stage,
- path: str | Path,
- position: Vec3f = Gf.Vec3f(0.0, 0.0, 0.0),
- orientation: Quatf = Gf.Quatf(1.0, Gf.Vec3f(0.0, 0.0, 0.0)),
- scale: Vec3f = Gf.Vec3f(1.0, 1.0, 1.0),
Add xform to the stage with given transformation.
- Parameters:
stage – The Usd.Stage to add cone.
path – The desired xform path.
position – The position where the xform should be placed in stage.
orientation – The xform orientation.
scale – The xform scale.
- omni.physx.scripts.physicsUtils.compute_bounding_box_diagonal(
- points: List[Float3],
Gets diagonal length of given point bounds.
- Parameters:
points – The input points.
- omni.physx.scripts.physicsUtils.copy_transform_as_scale_orient_translate(
- src: Xformable,
- dst: Xformable,
Copies the local transforms from one Xformable to another as a default scale->orient->translate stack.
- Note that:
Any skew in the src transform will be lost.
A resetXformStack is preserved, but not the XformOps that are ignored due to the reset.
The transform attribute precision of added XformOps is set to UsdGeom.XformOp.PrecisionFloat.
Obsolete xformOp: namespace attributes in dst are not removed (and cannot be for layers)
- Parameters:
src – The source Xformable.
dst – The destination Xformable.
- omni.physx.scripts.physicsUtils.create_mesh(
- stage: Stage,
- path: str | Path,
- points: List[Vec3f] | List[Vec3d],
- normals: List[Vec3f] | List[Vec3d],
- indices: List[int],
- vertexCounts: List[Vec3f],
Create UsdGeom.Mesh from given points, normals, indices and face counts.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
points – The input points.
normals – The input normals.
indices – The indices for faces.
vertexCounts – Face counts.
- omni.physx.scripts.physicsUtils.create_mesh_concave(
- stage: Stage,
- path: str | Path,
- halfSize: float,
Create UsdGeom.Mesh that represents a concave mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
halfSize – The half size of the mesh.
- omni.physx.scripts.physicsUtils.create_mesh_cone(
- stage: Stage,
- path: str | Path,
- height: float,
- radius: float,
- tesselation: int = 32,
Create UsdGeom.Mesh that represents a cone mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
height – The height of the cone.
radius – The radius of the cone.
tesselation – The tesselation of the cone mesh.
- omni.physx.scripts.physicsUtils.create_mesh_cube(
- stage: Stage,
- path: str | Path,
- halfSize: float,
Create UsdGeom.Mesh that represents a cube mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
halfSize – The half size of the cube.
- omni.physx.scripts.physicsUtils.create_mesh_cylinder(
- stage: Stage,
- path: str | Path,
- height: float,
- radius: float,
- tesselation: int = 32,
Create UsdGeom.Mesh that represents a cylinder mesh.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
height – The height of the cylinder.
radius – The radius of the cylinder.
tesselation – The tesselation of the cylinder mesh.
- omni.physx.scripts.physicsUtils.create_mesh_square_axis(
- stage: Stage,
- path: str | Path,
- axis: str,
- halfSize: float,
Create UsdGeom.Mesh that represents a square.
- Parameters:
stage – The Usd.Stage to add path.
path – The desired path to create.
axis – The up axis “Y”, “Z”.
halfSize – The half size of the square.
- omni.physx.scripts.physicsUtils.get_translation(prim: Prim) Vec3f | Vec3d#
Return translate attribute value from the given prim.
- Parameters:
prim – The Usd.Prim to check.
- omni.physx.scripts.physicsUtils.is_in_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Checks if a collision path belongs to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.remove_collision_from_collision_group(
- stage: Stage,
- collisionPath: str | Path,
- collisionGroupPath: str | Path,
Remove collision path to a collision group include rel.
- Parameters:
stage – The Usd.Stage to add path.
collisionPath – Collision path to add.
collisionGroupPath – Collision group prim path.
- omni.physx.scripts.physicsUtils.set_or_add_orient_op(
- xformable: Xformable,
- orient: Quatf | Quatd | Quath,
Sets or adds the orient XformOp on the input Xformable to provided orient value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
orient – The orient quaternion
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.set_or_add_scale_op(
- xformable: Xformable,
- scale: Vec3f | Vec3d | Vec3h,
Sets or adds the scale XformOp on the input Xformable to provided scale value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
scale – The scale vector
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.set_or_add_scale_orient_translate(
- xformable: Xformable,
- scale: Vec3f | Vec3d | Vec3h,
- orient: Quatf | Quatd | Quath,
- translate: Vec3f | Vec3d | Vec3h,
Sets or adds scale, orient, and translate XformOps of xformable.
- Note that:
The precision of created attributes is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
scale – The scale vector
orient – The orientation quaternion
translate – The translation vector
- Returns:
List of set and created xform ops that will be [translate, orient, scale]
- omni.physx.scripts.physicsUtils.set_or_add_translate_op(
- xformable: Xformable,
- translate: Vec3f | Vec3d | Vec3h,
Sets or adds the translate XformOp on the input Xformable to provided translate value.
- Note that:
The precision of an added attribute is UsdGeom.XformOp.PrecisionFloat.
- Parameters:
xformable – The Xformable to modify.
translate – The translate vector
- Returns:
The set or added XformOp
- omni.physx.scripts.physicsUtils.setup_transform_as_scale_orient_translate(
- xformable: Xformable,
Changes the local transform (ops) to the physics default scale->orient->translate stack.
- Note that:
Any skew in the transform will be lost.
A resetXformStack is preserved, but not the XformOps that are ignored due to the reset.
The transform attribute precision is set to UsdGeom.XformOp.PrecisionFloat.
Obsolete xformOp: namespace attributes are not removed (and cannot be for layers)
- Parameters:
xformable – The Xformable to modify.
- omni.physx.scripts.deformableUtils.add_auto_deformable_mesh_simplification(
- stage,
- prim_path: Path,
- Add a simplification collision mesh on a prim with PhysxSchema.PhysxAutoDeformableBodyAPI, and setup the deformable
body correspondingly.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Scope/UsdGeom.Xform to which the PhysxSchema.PhysxAutoDeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.add_deformable_material(
- stage: Stage,
- path,
- density=None,
- static_friction=None,
- dynamic_friction=None,
- youngs_modulus=None,
- poissons_ratio=None,
Applies the UsdPhysics.DeformableMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.add_surface_deformable_material(
- stage: Stage,
- path,
- density=None,
- static_friction=None,
- dynamic_friction=None,
- youngs_modulus=None,
- poissons_ratio=None,
- surface_thickness=None,
- surface_stretch_stiffness=None,
- surface_shear_stiffness=None,
- surface_bend_stiffness=None,
Applies the UsdPhysics.SurfaceDeformableMaterialAPI to the prim at path on stage.
- Parameters:
stage – The stage
path – Path to UsdShade.Material to which the material API should be applied to.
attributes (... schema) – See USD schema for documentation
- Returns:
True if the API apply succeeded.
- omni.physx.scripts.deformableUtils.create_auto_surface_deformable_hierarchy(
- stage: Stage,
- root_prim_path: str | Path,
- simulation_mesh_path: str | Path,
- cooking_src_mesh_path: str | Path,
- cooking_src_simplification_enabled: bool,
- set_visibility_with_guide_purpose: bool = False,
Creates a surface deformable body from a stage hierachy and adds necessary prims and APIs. For single prim deformable bodies, use set_physics_surface_deformable_body on a UsdGeom.Mesh.
- Parameters:
stage – The stage
root_prim_path – Path to valid a UsdGeom.Imageable which cannot be a UsdGeom.Gprim. The UsdPhysics.DeformableBodyAPI is applied to this prim.
simulation_mesh_path – Path to where simulation mesh should be created or a valid UsdGeom.Mesh.
cooking_src_mesh_path – Path to valid UsdGeom.Mesh that is used in cooking to generate the simulation mesh. May be outside of root_prim_path sub-hierarchy.
cooking_src_simplification_enabled – If True, PhysxAutoDeformableMeshSimplificationAPI is applied.
set_visibility_with_guide_purpose – If True, the simulation mesh is assigned the guide purpose to hide it from rendering - but only if other GPrims are present under root_prim_path to provide visible geometry.
- Returns:
True / False that indicates success of creation.
- omni.physx.scripts.deformableUtils.create_auto_volume_deformable_hierarchy(
- stage: Stage,
- root_prim_path: str | Path,
- simulation_tetmesh_path: str | Path,
- collision_tetmesh_path: str | Path,
- cooking_src_mesh_path: str | Path,
- simulation_hex_mesh_enabled: bool,
- cooking_src_simplification_enabled: bool,
- set_visibility_with_guide_purpose: bool = False,
Creates a volume deformable body from a stage hierachy and adds necessary prims and APIs. For single prim deformable bodies, use set_physics_volume_deformable_body on a UsdGeom.TetMesh.
- Parameters:
stage – The stage
root_prim_path – Path to valid a UsdGeom.Imageable which cannot be a UsdGeom.Gprim. The UsdPhysics.DeformableBodyAPI is applied to this prim.
simulation_tetmesh_path – Path to where simulation mesh should be created or a valid UsdGeom.TetMesh.
collision_tetmesh_path – Path to where collision mesh should be created or a valid UsdGeom.TetMesh. CollisionAPI is applied to the collision mesh. May be identical to simulation_tetmesh_path.
cooking_src_mesh_path – Path to valid UsdGeom.Mesh that is used in cooking to generate the simulation and collision mesh. May be outside of root_prim_path sub-hierarchy.
simulation_hex_mesh_enabled – If True, simulation mesh is generated as a hexahedral mesh.
cooking_src_simplification_enabled – If True, PhysxAutoDeformableMeshSimplificationAPI is applied.
set_visibility_with_guide_purpose – If True, the simulation and collision meshes are assigned the guide purpose to hide them from rendering - but only if other GPrims are present under root_prim_path to provide visible geometry. If the simulation and collision meshes are the only geometry present and are distinct, then only the simulation mesh is assigned the guide purpose, leaving the collision mesh for visual representation.
- Returns:
True / False that indicates success of creation.
- omni.physx.scripts.deformableUtils.create_triangle_mesh_square(dimx: int, dimy: int, scale: float = 1.0)#
Creates points and vertex data for a regular-grid flat triangle mesh square.
- Parameters:
dimx – Mesh-vertex resolution in X
dimy – Mesh-vertex resolution in Y
scale – Uniform scale applied to vertices
- Returns:
The vertex and index data
- Return type:
points, indices
- omni.physx.scripts.deformableUtils.set_physics_surface_deformable_body(
- stage,
- prim_path: Path,
Setup a surface deformable body based on a UsdGeom.Mesh at prim_path on stage and add necessary prims and APIs. For hierarchical setups use create_auto_surface_deformable_hierarchy.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.Mesh ‘sim mesh’ to which the UsdPhysics.DeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application
- omni.physx.scripts.deformableUtils.set_physics_volume_deformable_body(
- stage,
- prim_path: Path,
Setup a volume deformable body based on a UsdGeom.TetMesh at prim_path on stage and add necessary prims and APIs. For hierarchical setups use create_auto_volume_deformable_hierarchy.
- Parameters:
stage – The stage
prim_path – Path to UsdGeom.TetMesh ‘sim mesh’ to which the UsdPhysics.DeformableBodyAPI is applied to.
- Returns:
True / False that indicates success of schema application