omni.kit.manipulator.selector

Prim Manipulator Selector Extension

class omni.kit.manipulator.selector.ManipulatorBase(name: str, usd_context_name: str)

Bases: ABC

Base class for prim manipulator that works with ManipulatorSelector. Instead of subscribing to UsdStageEvent for selection change, manipulator should inherit this class and implements all abstractmethods to support choosing between multiple types of prim manipulators based on their order and enable criterions.

The order of the manipulator is specified at carb.settings path /persistent/exts/omni.kit.manipulator.selector/orders/<name>”

destroy()
abstract property enabled: bool

Returns if this manipulator is enabled.

abstract on_selection_changed(stage: Stage, selection: Optional[List[Path]], *args, **kwargs) bool

Function called when selection changes or types of prim manipulators are added or removed.

Parameters
  • stage (Usd.Stage) – the usd stage of which the selection change happens. It is the same as the stage of the UsdContext this manipulator works on.

  • selection (Union[List[Sdf.Path], None]) – the list of selected prim paths. If it is None (different from []), it means another manipulator with higher priority has handled the selection and this manipulator should yield.

Returns

True if selected prim paths can be handled by this manipulator and subsequent manipulator with higher order should yield. False if selected prim paths can not be handled. Function should always return False if selection is None.

class omni.kit.manipulator.selector.ManipulatorOrderManager

Bases: object

destroy()
property orders_dict: Dict[str, int]
subscribe_to_orders_changed(fn: Callable) int
unsubscribe_to_orders_changed(id: int)
class omni.kit.manipulator.selector.ManipulatorPrim

Bases: IExt

on_shutdown()
on_startup(ext_id)
class omni.kit.manipulator.selector.ManipulatorSelector(order_manager: ManipulatorOrderManager, usd_context_name: str)

Bases: object

destroy()
register_manipulator_instance(name: str, manipulator: ManipulatorBase)
unregister_manipulator_instance(name: str, manipulator: ManipulatorBase)
omni.kit.manipulator.selector.get_manipulator_selector(usd_context_name: str) ManipulatorSelector