ChangeRotationOpCommand#

class omni.kit.property.transform.ChangeRotationOpCommand(
src_op_attr_path: str,
op_name: str,
dst_op_attr_name: str,
is_inverse_op: bool,
auto_target_layer: bool = True,
)#

Bases: Command

A command to change the rotation XformOp in a USD stage.

This command updates the xformOpOrder, deletes the source xformOp attribute, creates a destination xformOp attribute, and copies the values from the source to the destination. If the operation is an inverse operation, it will add ‘!invert!’ in the xformOpOrder.

Args:

src_op_attr_path (str): Path of the source xformOp attribute. op_name (str): Name of the operation. dst_op_attr_name (str): Path of the destination xformOp attribute. is_inverse_op (bool): Indicates if the operation is an inverse operation. auto_target_layer (bool): Automatically target the correct layer for changes.

Example:
To change from xformOp:rotateZYX to xformOp:rotateXYZ, this command will:
  1. Update the xformOpOrder.

  2. Delete the xformOp:rotateZYX attribute.

  3. Create the xformOp:rotateXYZ attribute.

  4. Copy the values from xformOp:rotateZYX to xformOp:rotateXYZ.

Methods

__init__(src_op_attr_path, op_name, ...[, ...])

Initializes the ChangeRotationOpCommand instance.

do()

Executes the rotation operation change.

undo()

Reverts the rotation operation change.

__init__(
src_op_attr_path: str,
op_name: str,
dst_op_attr_name: str,
is_inverse_op: bool,
auto_target_layer: bool = True,
)#

Initializes the ChangeRotationOpCommand instance.

do()#

Executes the rotation operation change.

undo()#

Reverts the rotation operation change.