CreateUsdAttributeCommand
- class omni.usd.commands.CreateUsdAttributeCommand(prim: Prim, attr_name: str, attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None)
Bases:
Command
Create USD Attribute Command.
- Parameters
prim (Usd.Prim) – Usd.Prim that will get a new attribute.
attr_name (str) – New attribute’s name.
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.
- Example of usage:
- omni.kit.commands.execute(“CreateUsdAttribute”,
prim=prim, attr_name=”custom”, attr_type=Sdf.ValueTypeNames.Double3)
Methods
__init__
(prim, attr_name, attr_type[, ...])do
()undo
()- __init__(prim: Prim, attr_name: str, attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None)