DeletePrimsCommand#

class omni.usd.commands.DeletePrimsCommand(
paths: List[str | Path],
destructive=True,
stage: Stage | None = None,
context_name: str | None = None,
)#

Bases: Command, UsdStageHelper

Delete primitives from stage.

Methods

__init__(paths[, destructive, stage, ...])

Constructor.

do()

undo()

__init__(
paths: List[str | Path],
destructive=True,
stage: Stage | None = None,
context_name: str | None = None,
)#

Constructor.

Parameters:
  • paths (List[str]) – Paths to prims to delete.

  • destructive (bool, optional) –

    If it’s false, the delete will only happen in the current target, and follows: 1. If the prim spec is a def, it will remove the prim spec. 2. If the prim spec is a over, it will only deactivate this prim. 3. If the prim spec is not existed, it will create over prim and deactivate it. 4. If there is an overridden in a stronger layer, it will report errors.

    If it’s true, it will remove all prim specs in all local layers.

    By default, it’s True and means the delete operation is destructive for back-compatibility.

  • stage (Usd.Stage, optional) – Stage to operate. Default is None, which means to use the stage in the default UsdContext.

  • context_name (str, optional) – The usd context to operate. Default is None, which means to use the default UsdContext.