TransformPrimSRTCommand#

class omni.usd.commands.TransformPrimSRTCommand(
path: str,
new_translation: Vec3d | None = None,
new_rotation_euler: Vec3d | None = None,
new_scale: Vec3d | None = None,
new_rotation_order: Vec3i | None = None,
old_translation: Vec3d | None = None,
old_rotation_euler: Vec3d | None = None,
old_rotation_order: Vec3i | None = None,
old_scale: Vec3d | None = None,
time_code: TimeCode = Usd.TimeCode.Default(),
had_transform_at_key: bool = False,
usd_context_name: str = '',
)#

Bases: Command

Set primitive’s local transform with scale, rotation and transform values.

Methods

__init__(path[, new_translation, ...])

Constructor.

do()

undo()

__init__(
path: str,
new_translation: Vec3d | None = None,
new_rotation_euler: Vec3d | None = None,
new_scale: Vec3d | None = None,
new_rotation_order: Vec3i | None = None,
old_translation: Vec3d | None = None,
old_rotation_euler: Vec3d | None = None,
old_rotation_order: Vec3i | None = None,
old_scale: Vec3d | None = None,
time_code: TimeCode = Usd.TimeCode.Default(),
had_transform_at_key: bool = False,
usd_context_name: str = '',
)#

Constructor.

Parameters:
  • path (str) – Prim path.

  • new_translation (Gf.Vec3d, optional) – New local translation. Leave to None to use current value. Default is None.

  • new_rotation_euler (Gf.Vec3d, optional) – New local rotation euler angles (in degree). Leave to None to use current value. Default is None.

  • new_scale (Gf.Vec3d, optional) – New scale. Leave to None to use current value. Default is None

  • new_rotation_order (Gf.Vec3i, optional) – New rotation order (e.g. (0, 1, 2) means XYZ). Leave to None to use current value. Default is None.

  • old_translation (Gf.Vec3d, optional) – Old local translation for undo. Leave to None to use current value. Default is None.

  • old_rotation_euler (Gf.Vec3d, optional) – Old local rotation euler angles for undo. Leave to None to use current value. Default is None.

  • old_rotation_order (Gf.Vec3i, optional) – Old local rotation order for undo. Leave to None to use current value. Default is None.

  • old_scale (Gf.Vec3d, optional) – Old scale for undo. Leave to None to use current value. Default is None.

  • time_code (Usd.TimeCode, optional) – TimeCode to set transform to. Default is Usd.TimeCode.Default().

  • had_transform_at_key (bool) – If the local transform is set already before this command. This is used for undo to decide if it needs to clear the new value. Default is False.

  • usd_context_name (str) – The UsdContext to operate. Default is empty, which means the default UsdContext is used.