newton.viewer.ViewerNull#

class newton.viewer.ViewerNull(num_frames=1000)[source]#

Bases: ViewerBase

A no-operation (no-op) viewer implementation for Newton.

This class provides a minimal, non-interactive viewer that does not perform any rendering or visualization. It is intended for use in headless or automated environments where visualization is not required. The viewer runs for a fixed number of frames and provides stub implementations for all logging and frame management methods.

__init__(num_frames=1000)#

Initialize a no-op Viewer that runs for a fixed number of frames.

Parameters:

num_frames (int) – The number of frames to run before stopping.

begin_frame(time)#

No-op implementation for beginning a frame.

Parameters:

time – The current simulation time.

close()#

No-op implementation for closing the viewer.

end_frame()#

Increment the frame count at the end of each frame.

is_running()#

Check if the viewer should continue running.

Returns:

True if the frame count is less than the maximum number of frames.

Return type:

bool

log_array(name, array)#

No-op implementation for logging a generic array.

Parameters:
  • name – Name of the array.

  • array – The array data.

log_instances(name, mesh, xforms, scales, colors, materials, hidden=False)#

No-op implementation for logging mesh instances.

Parameters:
  • name – Name of the instance batch.

  • mesh – Mesh object.

  • xforms – Instance transforms.

  • scales – Instance scales.

  • colors – Instance colors.

  • materials – Instance materials.

  • hidden – Whether the instances are hidden.

log_lines(name, starts, ends, colors, width=0.01, hidden=False)#

No-op implementation for logging lines.

Parameters:
  • name – Name of the line batch.

  • starts – Line start points.

  • ends – Line end points.

  • colors – Line colors.

  • hidden – Whether the lines are hidden.

log_mesh(name, points, indices, normals=None, uvs=None, hidden=False, backface_culling=True)#

No-op implementation for logging a mesh.

Parameters:
  • name – Name of the mesh.

  • points (array) – Vertex positions.

  • indices (array) – Mesh indices.

  • normals (array | None) – Vertex normals (optional).

  • uvs (array | None) – Texture coordinates (optional).

  • hidden – Whether the mesh is hidden.

  • backface_culling – Whether to enable backface culling.

log_points(name, points, radii, colors, width=0.01, hidden=False)#

No-op implementation for logging points.

Parameters:
  • name – Name of the point batch.

  • points – Point positions.

  • radii – Point radii.

  • colors – Point colors.

  • hidden – Whether the points are hidden.

log_scalar(name, value)#

No-op implementation for logging a scalar value.

Parameters:
  • name – Name of the scalar.

  • value – The scalar value.