How to apply force on Rigid Body/Joints using Standalone python scripting


I am trying to create a very basic simulation of a point mass where I want to move the mass in a circle of constant radius.

To achieve this, I followed these steps:

  • I created a scene in USD file format using the GUI option.
  • I applied the Physics API (Mass, Force, and Rigid Body) to the sphere (prims) via the GUI.

My question:

I know that I can use the GUI option to set different variable values such as mass, linear velocity, and force. However, I want to set these variables through Python scripting. I couldn’t find the documentation for this. I am attaching the code and USD file for reference.

I hope this helps!

pointMass_path = str(_ROOT_DIR) + "/usd/point_mass/point_mass.usd"

my_world = World(stage_units_in_meters = 1.0,
                 physics_prim_path = "/World/physicsScene")
add_reference_to_stage(usd_path = pointMass_path,

while 1:


point_mass.usd (8.3 KB)

you should be able to use standard USD schema python code to do this. All physics demos are written and python, you can inspect the code. Open Window->Simulation->Physics->Demos, there each demo does have a python snippet code to showcase the feature.
Additionally you can check the doxygen documentation for UsdPhysics:

Or for PhysxSchema:

In general in python all works the same way as USD as all are USD schemas build on top of USD.

You can also check the omni.physx programmer guide, that does have examples for UsdPhysics, PhysxSchema python usage:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.