CreateFabricPrimWithDefaultXformCommand

class omni.fabric.commands.scripts.extension.CreateFabricPrimWithDefaultXformCommand(prim_type: str, prim_path: Optional[str] = None, select_new_prim: bool = True, attributes: Dict[str, Any] = {}, create_default_xform=True, stage: Optional[Stage] = None, context_name: Optional[str] = None)

Bases: Command, FabricStageHelper

A command to create a Fabric prim with a default transform.

This command creates a new prim of the specified type, at the given path, and applies a default transform to it. The newly created prim can be automatically selected.

Parameters
  • prim_type – str The type of prim to create (e.g., ‘Sphere’, ‘Cube’).

  • prim_path – str The path where the prim will be created. If None, it will be placed at the stage root or under default prim using the type name.

  • select_new_prim – bool Indicates whether to select the prim after creation.

  • attributes – Dict[str, Any] Optional dictionary of attributes to set after creation.

  • create_default_xform – bool Determines whether to create default transform attributes for the prim.

  • stage – Optional[usdrt.Usd.Stage] The stage where the prim will be created. If not provided, the default stage is used.

  • context_name – Optional[str] The name of the context to use for the operation. If not provided, the default context is used.

Methods

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

A command to create a Fabric prim with a default transform.

do()

Executes the command to create a new Fabric prim with default transform.

undo()

Undoes the creation of the new Fabric prim, effectively deleting it from the stage.

Attributes

attr_type_table

default_size_attr_table

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

A command to create a Fabric prim with a default transform.

do()

Executes the command to create a new Fabric prim with default transform.

If the prim already exists at the specified path, the command will fail and log an error.

undo()

Undoes the creation of the new Fabric prim, effectively deleting it from the stage.