AbstractTransformManipulatorModel#

class omni.kit.manipulator.transform.AbstractTransformManipulatorModel(**kwargs)#

Bases: AbstractManipulatorModel

An abstract base class for transform manipulator models.

This class provides a common interface for manipulation operations such as translate, rotate, and scale. Models derived from this class are responsible for updating the manipulator’s state and reflecting changes onto the underlying data.

Parameters:

**kwargs – Arbitrary keyword arguments that will be passed to AbstractTransformManipulatorModel.

Methods

__init__(**kwargs)

Initialize an abstract base class for transform manipulator models.

get_as_floats(item)

Return the operation items as a list of ints.

get_item(name)

Return manipulator item by name.

get_operation()

Called by the manipulator to determine which operation is active.

get_snap(item)

Called by the manipulator, returns the minimal increment step for each operation.

set_floats(item, value)

Called when the manipulator is being dragged and value changes, or set by external code to overwrite the value.

set_ints(item, value)

Called when the manipulator is being dragged and value changes, or set by external code to overwrite the value.

widget_disabled()

Called by hosting manipulator widget(s) when they're disabled.

widget_enabled()

Called by hosting manipulator widget(s) when they're enabled.

__init__(**kwargs)#

Initialize an abstract base class for transform manipulator models.

class OperationItem(
op: Operation,
)#

Bases: AbstractManipulatorItem

A class representing an operation item for transform manipulators.

Encapsulates an operation type to be used within transform manipulator models, such as translation, rotation, and scaling.

Parameters:

operation – Operation The specific transform operation this item represents.

get_as_floats(
item: AbstractManipulatorItem,
) List[int]#

Return the operation items as a list of ints. Called by manipulator to fetch item values.

Parameters:

item (sc.AbstractManipulatorItem) – input manipulator item.

Returns:

a composed Matrix4x4 transform in world space as a list of int.

Return type:

List[int]

get_item(
name: str,
) AbstractManipulatorItem#

Return manipulator item by name. See AbstractManipulatorItem.get_item

Parameters:

name – manipulator name.

Returns:

manipulator item matches the input name.

Return type:

sc.AbstractManipulatorItem

get_operation() Operation#

Called by the manipulator to determine which operation is active.

Returns:

The specific transform operation this item represents.

Return type:

Operation

get_snap(
item: AbstractManipulatorItem,
)#

Called by the manipulator, returns the minimal increment step for each operation. None if no snap should be performed. Different Operation requires different return values: - TRANSLATE: Tuple[float, float, float]. One entry for X/Y/Z axis. - ROTATE: float. Angle in degree. - SCALE: float

Parameters:

sc.AbstractManipulatorItem – input manipulator item.

Returns:

None

set_floats(
item: AbstractManipulatorItem,
value: List[float],
)#

Called when the manipulator is being dragged and value changes, or set by external code to overwrite the value. The model should update value to underlying data holder(s) (e.g. a USD prim(s)).

Depending on the model implemetation, item and value can be customized to model’s needs.

Parameters:
  • item (sc.AbstractManipulatorItem) – input manipulator item.

  • value (List[float]) – a composed Matrix4x4 transform in world space as a list of float.

set_ints(
item: AbstractManipulatorItem,
value: List[int],
)#

Called when the manipulator is being dragged and value changes, or set by external code to overwrite the value. The model should update value to underlying data holder(s) (e.g. a USD prim(s)).

Depending on the model implemetation, item and value can be customized to model’s needs.

Parameters:
  • item (sc.AbstractManipulatorItem) – input manipulator item.

  • value (List[float]) – a composed Matrix4x4 transform in world space as a list of int.

widget_disabled()#

Called by hosting manipulator widget(s) when they’re disabled. It can be used to track if any hosting manipulator is active to skip background model update (i.e. running listener for changes).

widget_enabled()#

Called by hosting manipulator widget(s) when they’re enabled. It can be used to track if any hosting manipulator is active to skip background model update (i.e. running listener for changes).