Physics Authoring Toolbar (PhysX Support UI)

Overview

This extension provides a toolbar including tools to streamline Physics authoring User Experience.

The goal is to make physics authoring more accessible and as much automated as possible.

Using the Omniverse Physics Authoring Toolbar begins with enabling the extension.

Check if extension is enabled

You can see if the extension is loaded by checking if the Physics Authoring Toolbar menu item exists.

../_images/ext_physics_supportui-toolbar_enable.png

If the Physics Authoring Toolbar menu item is missing, then it means that the extension is disabled.

Note

Omniverse USD Composer has the Support UI Extension enabled by default.

Enable the extension

Enable support ui extension

To enable the extension:

  1. Navigate to window > extensions

  2. In the search bar enter Support UI

  3. Locate the Support UI extension and select it.

  4. Select the Enabled toggle to enable the extension.

  5. Select the Check Mark next to auto-load to Load the Extension Automatically on App Start if desired.

  6. Close the Extensions Panel.

At this point the extension should be enabled. Click Window -> Simulation -> Physics Authoring Toolbar menu item and you should now see the support ui toolbar docked on the right of the viewport.

../_images/ext_physics_supportui-toolbar.png

Physics Authoring Toolbar

Authoring toolbar lets you create static and dynamic colliders (together with rigid bodies), enable automated creation of colliders, remove all physics components on prims, enable rigid body manipulator and selection mode and more.

Action

Description

Rigid Body Selection Mode

Toggles selection mode, which always tries to select an asset that contains a rigid body component.

Remove Physics Components

Removes all physics components on selected assets.

Create Static Colliders

Creates static collider types on selected assets.

Create Dynamic Colliders

Creates dynamic collider types on selected assets.

Automatic Creation of Colliders

Toggles automated creation of colliders.

Mass Distribution Manipulator

Toggles the Mass Distribution Manipulator.

Settings

Configures additional options, including the Physics Inspector

Rigid Body Selection Mode

Rigid Body Selection Mode is a special selection mode, which always tries to select an asset that contains a rigid body component. If current selection does not have it, it scans parent hierarchy starting from the current selection. If there is no rigid body found, current selection is preserved.

../_images/ext_physics_supportui-rigid_body_selection_mode.gif

Rigid Body Manipulator

The extension brings a custom version of gizmo manipulator called Rigid Body Manipulator, tailored specifically for physics-ready assets.

Note

Rigid Body Manipulator is by default enabled but works only in Simulation Mode and with only with physics-ready assets which have a rigid body component in hierarchy!

When active, the transform gizmo in simulation mode is moving and rotating objects using physics force, therefore objects properly collide with each other, links are used etc.

Note

Scaling is not supported.

../_images/ext_physics_supportui-rigid_body_manipulator.gif

Remove Physics Components

Removes all physics components on selected assets. E.g., all colliders, rigid bodies, mass settings, etc.

Create Static Colliders

Creates non-moveable colliders on all selected geometric assets and on their geometric children.

Note

While set to Static, objects cannot be moved with the transform gizmo.

Collider type can be selected via this button’s drop-down menu (hold left mouse button for a bit to open it).

Supported types:
  • Triangle Mesh = Exact Mesh, no approximation

  • Mesh Simplification Approximation = Simplified Mesh

Note

Any existing rigid body components are removed.

Create Dynamic Colliders

Creates moveable colliders with rigid bodies on all selected geometric assets and on their geometric children.

More details on how rigid body creation algorithm works:

  • If your selected assets have their Kind set to component, rigid bodies will be created on the component level. In this case, you are supposed to select just the parent asset. In case there is no component kind, the top most node from each selected asset gets rigid body created.

  • Rigid body is only created if there was none.

  • Rigid body will not be created if there is other rigid body up in the hierarchy. Warning will be produced.

Collider type can be selected via this button’s drop-down menu (hold left mouse button for a bit to open it).

Supported types:
  • Convex Hull Approximation

  • Convex Decomposition Approximation

Automatic Creation of Colliders

If enabled, colliders are being created automatically, immediately when assets are inserted into a stage. Also, missing colliders are also automatically created immediately after a stage gets loaded.

Settings

../_images/ext_physics_supportui-settings.png
Colliders section:
  • Async Cooking at Stage Load / Prim Add – with this option enabled, async cooking is triggered each time an asset is added to the stage, or right after a stage is loaded. Cooking pre-prepares assets for simulation.

Rigid Body section:
  • Physics Inspector: This option toggles the Physics Inspector panel.

  • Rigid Body Manipulator (in Simulation Mode): Refer to the toolbar section for more details. If enabled, the transform gizmo in simulation mode is moving and rotating objects using physics force, therefore objects properly collide with each other, links are used etc. Scaling is not supported.

    There are additional options available. All are enabled by default.
    • Allow Rotation While Translating – allows manipulated object to rotate when translating in a selected gizmo direction.

    • Allow Translation on Other Axes While Translating – allows translated object to be translated also on other axes than ones that were selected via the gizmo.

    • Allow Translation While Rotating – allows manipulated object to translate when rotating in a selected gizmo direction.

    • Allow Rotation on Other Axes While Rotating – allows rotated object to be rotated also on other axes than ones that were selected via the gizmo.

Info section:
  • Show Floating Notifications – you can turn off notifications when you find them too distracting. They are normally shown each time a collider is created or when physics components are removed.

Mass Distribution Manipulator

With this tool, you can easily view and potentially edit the mass attributes of a rigid body object. As an editing tool, the purpose is not to manipulate the total mass of a body; this can be done through the Mass component attributes section in the property panel (provided that the component has been added to the prim). Instead, you use the tool to define how the given mass is distributed, which is equally essential for realistic interaction with various forces and other bodies.

Note

For editing to be enabled, the rigid body must have the Mass component.

To add the Mass component to a rigid body, right click it, then pick Add > Physics > Mass. Notice that all the attributes are initially set to “Autocomputed”. In this state, NVIDIA PhysX derives the values by assuming that the mass is uniformly distributed throughout the provided geometry.

But in some cases, you might want attributes that reflect a non-uniform distribution, like when you have a car with a heavy base, which should then have a lower center of mass. You can use the Mass Distribution Manipulator to move about the center of mass by manipulating the arrows of the main gizmo to achieve this:

Moving the center of mass of a rigid body with the gizmo.

Sometimes, you might also have bodies where the mass is concentrated at the edges, like a metal barrel, which would result in a higher diagonal inertia than what is generated by PhysX. Or you could have a body where most of the mass is concentrated at the center, in which case the diagonal inertia should be lower. The Mass Distribution Manipulator helps you set attributes that reflect this by providing an approximation shape that you can manipulate to roughly correspond to the mass distribution of your rigid body. This approximation shape is what the cyan boxes signify.

When using the manipulator to set the diagonal inertia, aim to shape the boxes to dimensions that fit an object with mass distribution similar to your specific rigid body. You can manipulate the shape of the box in two ways. First, by using the circular handles:

Tweak the distribution with the gizmo.

This adjusts how the mass density is distributed between the edges and the center. For example, if the density is higher at the center (perhaps even because there is void at the proximities), you can move the handles closer to the center. Notice how the cyan box shrinks accordingly:

Example of the distribution representation.

You may also want to shift more mass to the edges of the body, like if you’re making an empty crate or barrel. To do this, move the handles away from the center. Notice how a new cyan box appears at the center and expands as you move the handle outwards. This shows what inside cutout would generate the output diagonal inertia:

Example of the distribution representation.

Note

The relative cutout size for all dimensions is always determined by the handle that is furthest away from the center.

Second, you can also rotate the shape by using the circles around the gizmo center. Setting this allows you to better fit the diagonal inertia to your concrete body:

Manipulate the principal axes with the gizmo.

Notice that even if it might seem rare that you can get the mass distribution manipulator shapes to match the exact physicality of your rigid body, as long as the dimensions roughly average out on something that is close, it will yield values that are good enough for most practical uses.

Physics Inspector

Physics Inspector allows navigating and authoring some USD physics objects without the need to simulate the entire USD stage. Currently selected objects are loaded into NVIDIA PhysX, according to the UsdPhysics and PhysXSchema schemas. Physics Inspector allows:

  • Exploring relations between:
    • Articulations

    • Bodies

    • Joints

    • Materials

  • Authoring of revolute and prismatic joints:
    • Body positions and orientations

    • Joint limits

  • Persisting authoring actions to USD
    • Supporting undo / redo

  • Quick selection of:
    • All Colliders connected to a Joint

    • All Bodies connected to a Joint

    • All Joints connected to a Body

    • All Colliders connected to a Body

Enable the Physics Inspector

Click the Physics Inspector checkbox under the settings of the physics authoring toolbar:

Enable the physics inspector.

A new window named Physics Inspector appears below the stage panel.

Basic Usage Tutorial

Let’s begin creating a simple revolute joint, with two colliders and a rigid body. The easiest way to do it is to load the Joint State demo.

  1. Reach for Window > Simulation > Demo Scenes

  2. In the Physics Demo Scenes tab search for Joint State demo, select it and click the Load Scene button.

  3. To better undestand the usage of the tool, set gravity to zero (typing 0 in the Property tab Physics > Scene > Gravity Magnitude).

  4. Select the articulation node in the stage inspector

  5. Enable the Physics Inspector by clicking the pencil icon in the support ui toolbar

  6. Change the value of the Drive Target / Position inside the Physics inspector window by dragging the slider or typing any number within the limits

  7. Disable the Physics Inspector by clicking the pencil icon in the support ui toolbar again

The new position of the joint is now permanently applied to box1.

Enable Physics Inspector Enable Physics Inspector Change Drive Target Value Up Change Drive Target Value Down

Authoring Support

Some physical attributes, like Joint Drive / Position or Joint Limits, can be authored directly in the inspector.

Example:

  1. Load an articulation in the stage

  2. Select the articulation in stage widget

  3. Change joints rotation by using the Drive Target / Position sliders.

Note

Selecting any USD node under ArticulationRootAPI to will extend the selection to the entire articulation in the inspector. For everything else you will have to select all joints and bodies / colliders meant to be inspected (or a common parent containing them)

Selection

The inspector interacts only with currently selected nodes in the usd stage. Any other object in the scene will not exhibit any physics behaviour during authoring, so it will not collide.

Example:

  1. Load an stage with multiple articulation

  2. Select one articulation

  3. Change joints by using the Drive Target / Position sliders.

  4. First articulation will be modified

  5. Select a different articulation

  6. Change joints by using the Drive Target / Position sliders.

  7. Second articulation will be modified

Note

Inspector automatically disables itself when stage enters simulation by pressing the Play button or when Zero Gravity is enabled

Joint State or Drive

The inspector can author joints that have either Joint State or Drive component applied. In the following example two different joints, one with Joint State and one with Drive component are being both authored by the inspector.

Note

The behaviour of the authored joint with Drive components depends on drive of damping / stiffness. If these values are not set properly, the joint may not move at all or it may oscillate indefintively. Joint State is only supported on articulations.

Lock selection

It’s possible to lock current selection, so that changing selection in the stage will not change what’s being inspected. When current selection is locked a red [LOCKED TO] text will appear before currently selected USD path.

Example:

  1. Select one articulation

  2. Author some of its properties

  3. Open Physics Inspector > Options

  4. Check Lock current inspector selection

  5. Now select a different articulation

  6. Authoring still refers to the initial articulation

Note

Selecting any row in the inspector will automatically lock current selection

Multiple windows

To create multiple inspector windows:

  1. Select some USD paths to Inspect

  2. Open Physics Inspector > Options

  3. Click New Inspector from selection

  4. The newly created inspector window will become active and it’s automatically locked to the current selection

  5. The new inspector window can be closed clicking the ‘x’ on top right corner

Note

All inspector objects in all windows will be interacting (colliding) with each other.

Selection sync with stage widget

Inspector window allows selecting any items inside of it (including also multiple selection). This selection is always in sync with the selection on the stage and property widgets. For example you can select some joints in the inspector and the property widget will show all properties belonging to both of them, the same way as if they were selected in the stage widget.

Note

Selecting an item in the inspector will lock the selection, but selecting an item in the stage window does not lock the selection.

Multiple articulations and joints

If selection contains a mix of multiple articulations and joints, the inspector:

  • Groups all joints not belonging to articulations into Maximal Joints tab

  • Creates one collapsing header for each articulation (containing all its joints)

Note

Maximal joints can be chained creating arbitrary loops, and modifying a single one may lead to unexpected results. When this happens use Options > Reset to Authoring start to restore it to initial state (before unselecting the object or disabling the inspector).

Masses and inertia overlay

To view all masses and inertia boxes belonging to an inspected object:

  1. Select some USD paths to Inspect

  2. Open Physics Inspector > Options

  3. Click Show masses and inertia overlay

  4. Hover on the Mass icon in the viewport to receive detailed information about the mass and inertia

Note

Changes to mass related attributes will be immediately reflected in the overlay visualization.

Undo authoring

Authoring related changes will be tracked in the undo stack. Changes to single usd attributes (like drive position) are un-done immediately, but the inspector must be enabled in order for the articulation to be simulated back to the original position, changing all relevant bodies position and orientations.

Note

In some cases, if the inspected object is not physically stable, the undo operation will not be able to bring it back to initial state. When this happens use Options > Reset to Authoring start to restore it to initial state (before unselecting the object or disabling the inspector).

Physics oriented selection context menu

Inspector can help in selecting physics objects that are connected to other relevant ones.

The following selection actions can be executed: - Select all Colliders connected to a Joint - Select all Bodies connected to a Joint - Select all Joints connected to a Body - Select all Colliders connected to a Body

Note

Selected objects are highlighed immediately in the stage widget, and corresponding usd paths are expanded to show the new selection

Joint, bodies, materials view

Physics inspector can display articulation hierarchy and the list of dynamic and static bodies with their joints of a given selection. To enable the hierarchical view:

  1. Select some USD paths to Inspect

  2. Open Physics Inspector > Options

  3. Select Inspection mode > Joints, Bodies, Materials

  • Articulations will be grouped in Articulations collapsing header.

  • Static bodies will be grouped in Static Bodies collapsing header

  • Dynamic bodies will be grouped in Dynamic Bodies collapsing header

  • Joints will be shown as children of the corresponding dynamic body.

Note

This view is useful to explore how omni.physx is resolving loops in articulation herarchies, to check results of exclude specific joints from articulations (relevant when specifying Exclude from Articulation in joint properties).

Materials

Inspector can show a tree of materials with the colliders they’re assigned to. Materials are show in a separate collapsing header named Materials just below.

Note

Material view is useful to make sure that a specific material has been assigned properly to a given set of collider prims (example: checking that all colliders for wheels of a vehicle are assigned to their specific material)