ReorderPrimCommand

class omni.kit.widget.stage.ReorderPrimCommand(stage: Stage, prim_path: Path, move_to_location: int)

Bases: Command

Command to reorder prim under its parent. This command uses the support from USD to override the reorder property, and it will always be authored into the root layer without considering the edit target.

Methods

__init__(stage, prim_path, move_to_location)

Constructor.

do()

Moves the prim to the specified location.

undo()

Restores the prim to its previous location.

__init__(stage: Stage, prim_path: Path, move_to_location: int)

Constructor.

Parameters
  • stage (Usd.Stage) – USD stage.

  • prim_path (Sdf.Path) – Prim to reorder.

  • move_to_location (int) – Move to the location in its parent. If it’s -1, it means to move the prim to the bottom.

do()

Moves the prim to the specified location.

undo()

Restores the prim to its previous location.