TransformFabricPrimCommand
- class omni.fabric.commands.scripts.extension.TransformFabricPrimCommand(path: str, new_transform_matrix: Matrix4d, old_transform_matrix: Optional[Matrix4d] = None, is_world_xform: bool = False, time_code: TimeCode = Usd.TimeCode.Default(), usd_context_name: str = '')
Bases:
Command
A command to transform a Fabric prim.
This command applies a specified transformation matrix to a Fabric prim at a given path. It can operate in either world or local space and supports undo/redo operations.
- Parameters
path – str Prim path.
new_transform_matrix – usdrt.Gf.Matrix4d New local/world transform matrix.
old_transform_matrix – usdrt.Gf.Matrix4d Optional old local/world transform matrix to undo to. If `None` use current transform.
is_world_xform – bool Whether the transformation is applied in world space (True) or local space (False). Defaults to False.
time_code – usdrt.Usd.TimeCode The timecode at which the transformation is applied. Defaults to usdrt.Usd.TimeCode.Default().
usd_context_name – str The name of the USD context the command operates within. Defaults to an empty string, which uses the default context.
Methods
__init__
(path, new_transform_matrix[, ...])Creates a TransformFabricPrimCommand to perform transformations on a Fabric prim.
do
()Executes the command to transform a Fabric prim.
undo
()Undoes the transformation of the Fabric prim, effectively reset the prim to the old transformation
- __init__(path: str, new_transform_matrix: Matrix4d, old_transform_matrix: Optional[Matrix4d] = None, is_world_xform: bool = False, time_code: TimeCode = Usd.TimeCode.Default(), usd_context_name: str = '')
Creates a TransformFabricPrimCommand to perform transformations on a Fabric prim.
- Parameters
path (str) – The path to the Fabric prim to transform.
new_transform_matrix (usdrt.Gf.Matrix4d) – A 4x4 transformation matrix specifying the new transformation.
old_transform_matrix (usdrt.Gf.Matrix4d, optional) – The original transformation matrix before the transformation.
- do()
Executes the command to transform a Fabric prim.
- undo()
Undoes the transformation of the Fabric prim, effectively reset the prim to the old transformation