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:
- 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
- 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
- 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
- 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
- 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
- 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:
- render_sphere(name, pos, rot, radius, parent_body=None, is_template=False, color=None, visible=True)#
Debug helper to add a sphere for visualization
- use_unique_colors = True#