USDViewer#

class ansys.tools.usdviewer.viewer.USDViewer(title: str = 'Viewer', size: tuple[int, int] = (750, 750))#

USD Viewer to load and display USD files in a Qt window.

Parameters#

titlestr, default: "Viewer"

Title of the viewer window.

sizetuple[int, int], default: (750, 750)

Size of the viewer window in this format: (width, height).

Overview#

plot

Plot the given USD stage in the viewer window.

show

Show the USD Viewer window.

load_usd

Load a USD stage from a given file path.

load_asset

Load any supported asset (such as USD or VTK) as a USD stage.

Import detail#

from ansys.tools.usdviewer.viewer import USDViewer

Method detail#

USDViewer.plot(stage: pxr.Usd.Stage) None#

Plot the given USD stage in the viewer window.

Parameters#

stageUsd.Stage

USD stage to display.

USDViewer.show() None#

Show the USD Viewer window.

Displays the USD Viewer window and starts the Qt app event loop.

USDViewer.load_usd(path: str) pxr.Usd.Stage#

Load a USD stage from a given file path.

Parameters#

pathstr

File path to the USD file.

USDViewer.load_asset(asset_path: str) pxr.Usd.Stage#

Load any supported asset (such as USD or VTK) as a USD stage.

Parameters#

asset_pathstr

Path to the asset file. File options include USD, VTK, OBJ, PLY, and STL.

Returns#

Usd.Stage

Loaded USD stage.