CreateUsdAttributeOnPathCommand

class omni.usd.commands.CreateUsdAttributeOnPathCommand(attr_path: Union[Path, str], attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None, usd_context_name: str = '')

Bases: Command

Create USD Attribute Command.

Parameters
  • attr_path (Union[Sdf.Path, str]) – Path to the new attribute to be created. The prim of this path must already exist.

  • attr_type (Sdf.ValueTypeName) – New attribute’s type.

  • custom (bool) – If the attribute is custom.

  • variability (Sdf.Variability) – whether the attribute may vary over time and value coordinates, and if its value comes through authoring or from its owner.

  • attr_value (Any, optional) – New attribute’s value. Leave it as None to use default value.

  • usd_context_name (str) – Name of the usd context to execute the command on.

Example of usage:
omni.kit.commands.execute(“CreateUsdAttribute”,

prim=prim, attr_name=”custom”, attr_type=Sdf.ValueTypeNames.Double3)

Methods

__init__(attr_path, attr_type[, custom, ...])

do()

undo()

__init__(attr_path: Union[Path, str], attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None, usd_context_name: str = '')