CreatePrimWithDefaultXformCommand#

class omni.usd.commands.CreatePrimWithDefaultXformCommand(
prim_type: str,
prim_path: str | None = None,
select_new_prim: bool = True,
attributes: Dict[str, Any] = {},
create_default_xform=True,
stage: Stage | None = None,
context_name: str | None = None,
)#

Bases: Command, UsdStageHelper

Create a primitive to stage.

Methods

__init__(prim_type[, prim_path, ...])

Constructor.

do()

undo()

__init__(
prim_type: str,
prim_path: str | None = None,
select_new_prim: bool = True,
attributes: Dict[str, Any] = {},
create_default_xform=True,
stage: Stage | None = None,
context_name: str | None = None,
)#

Constructor.

Parameters:
  • prim_type (str) – Primitive type supported by USD, e.g. “Xform”, “Camera”, “Sphere”, “Cube” etc.

  • prim_path (str, optional) – Path of the primitive to be created at. If None is provided, it will be placed at stage root or under default prim using Type name. Default is None.

  • select_new_prim (bool, optional) – Whether to select the prim after it’s created. Default is True.

  • attributes (Dict[str, object], optional) – Attributes dict to set after creation. Default is {}.

  • create_default_xform (bool, optional) – Whether to create default xform operators. Default is True.

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

  • context_name (str, optional) – The usd context to operate. Default is None, which means the default UsdContext is used. Param `stage`, to some extent, is duplicate to this param. They are both kept for back-compatibility.