PrimSelectionPayload

class omni.kit.property.material.scripts.widgets.backdrop_widget.PrimSelectionPayload(stage: <weakref at 0x7ffa1260b1a0; to 'Boost.Python.class' at 0x2c4a570 (Stage)>, paths: ~typing.List[~pxr.Sdf.Path])

Bases: object

A class to encapsulate the selection payload for a USD stage’s prim paths.

This class holds a weak reference to a USD stage and a list of SDF paths representing selected prims. It provides methods to interact with the selection data, including checking the length, iteration, indexing, and determining if the selection exceeds a predefined large selection count.

Parameters
  • stage (weakref.ReferenceType(Usd.Stage)) – A weak reference to the stage from which prims are selected.

  • paths (List[Sdf.Path]) – A list of SDF paths to selected prims.

Methods

__init__(stage, paths)

Initializes a new instance of the PrimSelectionPayload.

cleanup_payload()

Removes any deleted prims from payload list and returns valid payload

get_large_selection_count()

Gets the count of items considered as a large selection.

get_paths()

Gets the list of paths stored in the payload.

get_stage()

Retrieves the stage associated with the payload.

is_large_selection()

Determines if the current selection is considered large.

set_large_selection_override(state)

Sets the override state for large selection handling.

__init__(stage: <weakref at 0x7ffa1260b1a0; to 'Boost.Python.class' at 0x2c4a570 (Stage)>, paths: ~typing.List[~pxr.Sdf.Path])

Initializes a new instance of the PrimSelectionPayload.

cleanup_payload()

Removes any deleted prims from payload list and returns valid payload

get_large_selection_count()

Gets the count of items considered as a large selection.

Returns

The count used to determine large selections.

Return type

int

get_paths() List[Path]

Gets the list of paths stored in the payload.

Returns

The paths associated with this payload.

Return type

List[Sdf.Path]

get_stage()

Retrieves the stage associated with the payload.

Returns

The stage if available, otherwise None.

Return type

weakref.ReferenceType(Usd.Stage)

is_large_selection() bool

Determines if the current selection is considered large.

Returns

True if the selection is large, otherwise False.

Return type

bool

set_large_selection_override(state: bool)

Sets the override state for large selection handling.

Parameters

state (bool) – True to ignore large selection checks.