MovePrimCommand

class omni.usd.commands.MovePrimCommand(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, destructive=True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None, resolve_reference: bool = True)

Bases: Command

Move primitive undoable Command.

Parameters
  • path_from (str) – Path to move prim from.

  • path_to (str) – Path to move prim to.

  • time_code (Usd.TimeCode) – Current timecode of the stage.

  • keep_world_transform (bool) – True to keep world transform after prim path is moved. False to keep local transfrom only.

  • on_move_fn (Callable) – Function to call when prim is renamed

  • destructive (bool) – If it’s false, it will not remove original prim but deactivate it. By default, it’s true for back compatibility.

  • stage_or_context – (Union[str, Usd.Stage, omni.usd.UsdContext]): Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext.

Methods

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

do()

modify_callback_info(cb_type, cmd_args)

Returns a dictionary of information to be passed to callbacks of the given type.

undo()

__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, destructive=True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None, resolve_reference: bool = True)
modify_callback_info(cb_type: str, cmd_args: Dict[str, Any]) Dict[str, Any]

Returns a dictionary of information to be passed to callbacks of the given type.

By default callbacks are passed a copy of the arguments which were passed to execute() when the command was invoked. This method can be overridden to modify that information for specific callback types.

Parameters
  • cb_type – Type of callback the information will be passed to.

  • args – A dictionary containing a copy of the arguments with which the command was invoked. This is a shallow copy so implementations may add, remove or replace dictionary elements but should not modify any of the objects contained within it.

Returns

A dictionary of information to be passed to callbacks of the specified type.