Adds a set of attributes to an object or a collection. You can only add one custom attribute set of a particular attributes definition to an object, but you can have as many different attribute sets from different definitions as needed.
When adding custom attributes to an object using the custAttributes.add() function, you can now supply an optional #unique keyword as the third argument. If you do this, each object being added to will have custom attributes added that have their own private copy of the definition and do *not* share the original definition. Any later redefinitions of the original attributes definition will not update these custom attributes. To update the individual object's attributes, you would get the unique definition from the object using custAttributes.getDef , and redefine it in one of the two ways described.
If the optional keyword argument baseObject is set to true (the default), in case the object specified is a node, the base object will be operated on. If false , the node itself will be operated on.
The custAttributes.add() function can be applied to an object collection to add sets of attributes to a group of objects in one go.
EXAMPLE |
Adds a separate set of these custom attributes to all objects whose names begin "weapon" in the scene. |
As with Scripted plug-ins, an attributes definition can have any number of sets of parameter and rollout clauses, to allow you to organize added attributes into multiple rollouts as needed.
Scripted custom attributes added to an object or modifier can be accessedviaMAXScript. They turn up directlyas properties on the objectsthey are added to. If the names of any of the custom attributes are the same as existing properties on the host object, the custom attributes are effectively hidden when accessed directly. As an alternative, you can access each added block of custom attributesby their attributes definition nameand then access individual attributes as properties within that block.