Selection#

class omni.usd.Selection#

Bases: pybind11_object

omni.usd.Selection manages all stage selections and provides APIs for querying/setting selections.

Methods

__init__(*args, **kwargs)

clear_selected_prim_paths(self, source)

Clears all selections.

get_selected_prim_paths(self, source)

Gets selected prim paths.

is_prim_path_selected(self, path, source)

Checks if a prim is selected or not.

select_all_prims(self[, type_names])

Selects all prims with specific prim types.

select_inverted_prims(self)

Selects all prims without the current selections.

set_prim_path_selected(self, path, selected, ...)

Selects/Unselects single prim.

set_selected_prim_paths(self, paths, ...)

Sets selected prim paths.

__init__(*args, **kwargs)#
class SourceType#

Bases: pybind11_object

Selection source stage.

Members:

USD : Selections from native USD stage.

FABRIC : “Selections from Fabric.

ALL : Selections from both native USD stage and Fabric.

property name#
clear_selected_prim_paths(
self: omni.usd._usd.Selection,
source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>,
) bool#

Clears all selections.

Parameters:

source (omni.usd.Selection.SourceType) – The source to be cleared. Selections are stored differently for Fabric. By default, it will check selections from native USD stage.

get_selected_prim_paths(
self: omni.usd._usd.Selection,
source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>,
) List[str]#

Gets selected prim paths.

Parameters:

source (omni.usd.Selection.SourceType) – The source to get selections. Selections are stored differently for Fabric. By default, it will check selections from native USD stage.

Returns:

List of selected prim paths.

is_prim_path_selected(
self: omni.usd._usd.Selection,
path: str,
source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>,
) bool#

Checks if a prim is selected or not.

Parameters:
  • path (str) – Prim path to be checked.

  • source (omni.usd.Selection.SourceType) – The source to be checked. Selections are stored differently for Fabric. By default, it will check selections from native USD stage.

select_all_prims(
self: omni.usd._usd.Selection,
type_names: object = None,
) None#

Selects all prims with specific prim types.

select_inverted_prims(self: omni.usd._usd.Selection) None#

Selects all prims without the current selections.

set_prim_path_selected(
self: omni.usd._usd.Selection,
path: str,
selected: bool,
forcePrim: bool,
clearSelected: bool,
expandInStage: bool = True,
source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>,
) bool#

Selects/Unselects single prim.

Parameters:
  • path (str) – Prim path to be selected.

  • selected (bool) – Selected or unselected.

  • forcePrim (bool) – Force it to be Prim Mode. When this option is false, it depends on the selection mode to decide the prim to be selected.

  • clearSelected (bool) – Clears existing selections or not before selection.

  • expandInStage (bool) – DEPRECATED.

  • source (omni.usd.Selection.SourceType) – The source to be set. Selections are stored differently for Fabric. By default, it will check selections from native USD stage.

set_selected_prim_paths(self: omni.usd._usd.Selection, paths: List[str], expandInStage: bool = True, source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>) bool#

Sets selected prim paths.

Parameters:
  • paths (List[str]) – The list of prim paths to be selected.

  • expandInStage (bool) – DEPRECATED.

  • source (omni.usd.Selection.SourceType) – The source to be set. Selections are stored differently for Fabric. By default, it will check selections from native USD stage.