ParentPrimsCommand

class omni.usd.commands.ParentPrimsCommand(parent_path: str, child_paths: List[str], on_move_fn: Optional[callable] = None, keep_world_transform: bool = True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)

Bases: Command

Moves prims into children of “parent” primitives.

Methods

__init__(parent_path, child_paths[, ...])

Constructor.

do()

undo()

__init__(parent_path: str, child_paths: List[str], on_move_fn: Optional[callable] = None, keep_world_transform: bool = True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None)

Constructor.

Parameters
  • parent_path (str) – prim path to become parent of child_paths

  • child_paths (List[str]) – prim paths to become children of parent_prim

  • on_move_fn (Callable[[Sdf.Path, Sdf.Path], None], optional) – Function to call when prim is re-parented, that the first param is the source path, and second one is the target path. Defaults to None.

  • keep_world_transform (bool, optional) – If it needs to keep the world transform after parenting. Defaults to True

  • stage_or_context (Union[str, Usd.Stage, omni.usd.UsdContext], optional) – 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.