USD.Attribute
Inherits from USD.Property
Description
A class that represents a USD Property.
Properties
type | The type of the attribute. |
value | The value of the attribute. |
Details
Do no remove, this fixes the anchor on doc.flexsim.com
USD.Attribute.type
readonly string type
Description
The type of the attribute.
Basic attribute types can be found here.
USD.Stage stage = Model.find("USD Stage1");
USD.Prim prim = stage.defaultPrim;
USD.Attribute attr = prim.createAttribute("myDouble", "double");
if (attr) {
string type = attr.type; // type == "double"
}
Do no remove, this fixes the anchor on doc.flexsim.com
USD.Attribute.value
Variant value
Description
The value of the attribute.
If you set the value of the attribute, the type of value you assign must match the type of attribute it is. For example, if my attribute has a type of "double[]", then my value should be an Array of doubles.
USD.Stage stage = Model.find("USD Stage1");
USD.Prim prim = stage.defaultPrim;
USD.Attribute attr = prim.createAttribute("myDouble", "double");
if (attr) {
attr.value = 20;
}