MoveFabricPrimCommand

class omni.fabric.commands.scripts.commands.MoveFabricPrimCommand(path_from: Union[str, Path], path_to: Union[str, Path], time_code: TimeCode = Usd.TimeCode.Default(), keep_world_transform: bool = True, on_move_fn: Optional[Callable] = None, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)

Bases: Command

A command for moving a single prim from one path to another within the Fabric stage.

This command updates the scene graph to reflect the new location of the prim and maintains its world transform if specified. The command supports undo and redo operations.

Parameters
  • path_from – Union[str, usdrt.Sdf.Path] The source path from which the prim is to be moved.

  • path_to – Union[str, usdrt.Sdf.Path] The target path to which the prim is to be moved to.

  • time_code – usdrt.Usd.TimeCode The timecode at which the move operation is performed. Defaults to usdrt.Usd.TimeCode.Default().

  • keep_world_transform – bool Whether to maintain the world transform of the prim after moving. Defaults to True.

  • on_move_fn – Callable An optional callback function to be called after the move operation. Defaults to None

  • stage_or_context – Union[str, usdrt.Usd.Stage, omni.usd.UsdContext] The stage or context where the prim is moved. Can be a stage instance, context instance, or context name. Defaults to None

Methods

__init__(path_from, path_to[, time_code, ...])

Creates a command to move a Fabric prim from one path to another.

do()

Executes the command to move the specified Fabric prim to the new location.

undo()

Undoes the move of the specified Fabric prims, restoring them to the previous location

__init__(path_from: Union[str, Path], path_to: Union[str, Path], time_code: TimeCode = Usd.TimeCode.Default(), keep_world_transform: bool = True, on_move_fn: Optional[Callable] = None, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)

Creates a command to move a Fabric prim from one path to another.

do()

Executes the command to move the specified Fabric prim to the new location.

undo()

Undoes the move of the specified Fabric prims, restoring them to the previous location