Access to Custom Attributes Virtual Array

Custom attributes in MAXScript can now be applied to any type of MAX object, including nodes and the scene rootnode. However, the rollouts associated with the custom attributes will only be displayed for materials, modifiers, and base objects.

A .custAttributes property has been added to MAXWrapper in 3ds Max 5.1. It contains a virtual array of the custom attributes assigned to the object. Standard array methods and operations can be performed on this virtual array, with the exception of join and sort .

The class of the virtual array is MSCustAttribArray .

Supported operations are:

findItem < MSCustAttribArray > < cust_attrib > 	 

Find the given custom attribute in the supplied virtual array.

   

< MSCustAttribArray > [< integer > | < cust_attrib_name >]

Get a custom attribute by index or name.

   

< MSCustAttribArray > [< integer > | < cust_attrib_name >] = < cust_attrib >

Set a custom attribute by index or name.

NOTE:

NULL/undefined values cannot be stored in a MSCustAttribArray, so if you perform an indexed write where the index is greater than the number of existing custom attributes, the custom attribute will be appended to the MSCustAttribArray.

   

append < MSCustAttribArray > < cust_attrib >   

Add a custom attribute to the end of the virtual array.

   

deleteItem < MSCustAttribArray > (< cust_attrib > | < cust_attrib_name >) 

Delete a custom attribute from the virtual array by providing the custom attribute or its name.

You can also map across the MSCustAttribArray.

Next Topic:

Custom Attributes in Materials and Texture Maps

See Also