newton.utils.SimRendererUsd#
- class newton.utils.SimRendererUsd(model, stage, source_stage=None, scaling=1.0, fps=60, up_axis=None, show_joints=False, path_body_map=None, path_body_relative_transform=None, builder_results=None, **render_kwargs)[source]#
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.
This renderer supports rendering a Newton simulation as a time-sampled animation of USD prims through the render_update_stage method. This method requires a source stage, a path_body_map, a path_body_relative_transform, and builder_results.
- 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
- __init__(model, stage, source_stage=None, scaling=1.0, fps=60, up_axis=None, show_joints=False, path_body_map=None, path_body_relative_transform=None, builder_results=None, **render_kwargs)#
Construct a SimRendererUsd object.
- Parameters:
model (newton.Model) β The Newton physics model to render.
stage (str | Usd.Stage) β The USD stage to render to. This is the output stage.
source_stage (str | Usd.Stage, optional) β The USD stage to use as a source for the output stage.
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. Defaults to None.
show_joints (bool, optional) β Whether to show joint visualizations. Defaults to False.
path_body_map (dict, optional) β A dictionary mapping prim paths to body IDs.
path_body_relative_transform (dict, optional) β A dictionary mapping prim paths to relative transformations.
builder_results (dict, optional) β A dictionary containing builder results.
**render_kwargs β Additional arguments passed to the underlying UsdRenderer.