newton.utils.SimRendererUsd#

class newton.utils.SimRendererUsd(model, path, scaling=1.0, fps=60, up_axis=None, show_rigid_contact_points=False, contact_points_radius=1e-3, show_joints=False, show_particles=True, **render_kwargs)#

Bases: SimRenderer

USD renderer for Newton Physics simulations.

This renderer exports simulation data to USD (Universal Scene Description) format, which can be visualized in Omniverse or other USD-compatible viewers.

Parameters:
  • model (newton.Model) – The Newton physics model to render.

  • path (str) – Output path for the USD file.

  • scaling (float, optional) – Scaling factor for the rendered objects. Defaults to 1.0.

  • fps (int, optional) – Frames per second for the animation. Defaults to 60.

  • up_axis (newton.AxisType, optional) – Up axis for the scene. If None, uses model’s up axis.

  • show_rigid_contact_points (bool, optional) – Whether to show contact points. Defaults to False.

  • contact_points_radius (float, optional) – Radius of contact point spheres. Defaults to 1e-3.

  • show_joints (bool, optional) – Whether to show joint visualizations. Defaults to False.

  • **render_kwargs – Additional arguments passed to the underlying UsdRenderer.

Example

import newton

model = newton.Model()  # your model setup
renderer = newton.utils.SimRendererUsd(model, "output.usd", scaling=2.0)
# In your simulation loop:
renderer.begin_frame(time)
renderer.render(state)
renderer.end_frame()
renderer.save()  # Save the USD file

Methods

__init__(model, path[, scaling, fps, ...])

Construct a UsdRenderer object.

render(state)

Updates the renderer with the given simulation state.

render_box(name, pos, rot, extents[, ...])

Debug helper to add a box for visualization

render_capsule(name, pos, rot, radius, ...)

Debug helper to add a capsule for visualization

render_cone(name, pos, rot, radius, half_height)

Debug helper to add a cone for visualization

render_cylinder(name, pos, rot, radius, ...)

Debug helper to add a cylinder for visualization

render_line_list(name, vertices, indices[, ...])

Debug helper to add a line list as a set of capsules

render_plane(name, pos, rot, width, length)

Render a plane with the given dimensions.

render_sphere(name, pos, rot, radius[, ...])

Debug helper to add a sphere for visualization

Attributes

__init__(model, path, scaling=1.0, fps=60, up_axis=None, show_rigid_contact_points=False, contact_points_radius=1e-3, show_joints=False, show_particles=True, **render_kwargs)#

Construct a UsdRenderer object.

Parameters:
  • model (Model) – A simulation model

  • stage (str/Usd.Stage) – A USD stage (either in memory or on disk)

  • up_axis (str) – The upfacing axis of the stage

  • fps (int) – The number of frames per second to use in the USD file

  • scaling (float) – Scaling factor to use for the entities in the scene

populate(model)#
render(state)#

Updates the renderer with the given simulation state.

Parameters:

state (newton.State) – The simulation state to render.

render_box(name, pos, rot, extents, parent_body=None, is_template=False, color=None, visible=True)#

Debug helper to add a box for visualization

Parameters:
  • pos (tuple) – The position of the box

  • extents (tuple) – The radius of the box

  • name (str) – A name for the USD prim on the stage

  • color (tuple[float, float, float] | None) – The color of the box

render_capsule(name, pos, rot, radius, half_height, parent_body=None, is_template=False, up_axis=1, color=None, visible=True)#

Debug helper to add a capsule for visualization

Parameters:
  • pos (tuple) – The position of the capsule

  • radius (float) – The radius of the capsule

  • half_height (float) – The half height of the capsule

  • name (str) – A name for the USD prim on the stage

  • color (tuple[float, float, float] | None) – The color of the capsule

render_cone(name, pos, rot, radius, half_height, parent_body=None, is_template=False, up_axis=1, color=None, visible=True)#

Debug helper to add a cone for visualization

Parameters:
  • pos (tuple) – The position of the cone

  • radius (float) – The radius of the cone

  • half_height (float) – The half height of the cone

  • name (str) – A name for the USD prim on the stage

  • color (tuple[float, float, float] | None) – The color of the cone

render_cylinder(name, pos, rot, radius, half_height, parent_body=None, is_template=False, up_axis=1, color=None, visible=True)#

Debug helper to add a cylinder for visualization

Parameters:
  • pos (tuple) – The position of the cylinder

  • radius (float) – The radius of the cylinder

  • half_height (float) – The half height of the cylinder

  • name (str) – A name for the USD prim on the stage

  • color (tuple[float, float, float] | None) – The color of the cylinder

render_line_list(name, vertices, indices, color=None, radius=0.01, visible=True)#

Debug helper to add a line list as a set of capsules

Parameters:
  • vertices – The vertices of the line-strip

  • color (tuple[float, float, float] | None) – The color of the line

  • time – The time to update at

render_plane(name, pos, rot, width, length, color=(1.0, 1.0, 1.0), color2=None, parent_body=None, is_template=False, u_scaling=1.0, v_scaling=1.0, visible=True)#

Render a plane with the given dimensions.

Parameters:
  • name (str) – Name of the plane

  • pos (tuple) – Position of the plane

  • rot (tuple) – Rotation of the plane

  • width (float) – Width of the plane

  • length (float) – Length of the plane

  • color (tuple[float, float, float]) – Color of the plane

  • parent_body (str | None) – Name of the parent body

  • is_template (bool) – Whether the plane is a template

render_sphere(name, pos, rot, radius, parent_body=None, is_template=False, color=None, visible=True)#

Debug helper to add a sphere for visualization

Parameters:
  • pos (tuple) – The position of the sphere

  • radius (float) – The radius of the sphere

  • name (str) – A name for the USD prim on the stage

  • color (tuple[float, float, float] | None) – The color of the sphere

use_unique_colors = True#