Value > ArrayParameter Values |
Certain plug-ins in 3ds Max store parameter data in a form that is accessible by MAXScript as ArrayParameters. As such, you can access the parameter data by index and iterate over the parameter data.
Where the parameter contains an ArrayParameter.
Returns the number of values in the ArrayParameter. Read-only in most cases with exceptions noted in the MAXWrapper object description where an adjustable ArrayParameter is used.
Returns the element of ArrayParameter. Indexes start at 1.
Sets the element of ArrayParameter to a value.
Each ArrayParameter can only contain data of a certain type (for example, Float), or a controller that matches that data type. The showProperties() function indicates these array parameters as <type> array , for example, int array , texmap array , and so on.
A plug-in can also define parameter names that point to specific entries in one of its ArrayParameters. For example, mapAmounts is a property of Standard materials containing an ArrayParameter. Each element in this ArrayParameter contains the map amount for one of the map channels. For easier access in a script, the Standard .ambientMapAmount property is provided as an alias for mapAmounts[1] (along with aliases for all the other common maps). You can access the controller for the ambientMapAmount alias either through the .controller property on the alias or on the .mapAmounts[1] property.
ArrayParameter values can be coerced to Array in 3ds Max 6 and higher.
The following script shows the use of showProperties() to show the data type for elements of ArrayParameters, access to ArrayParameter elements, and a case of a plug-in defining parameter names that point to a specific entry in one of its ArrayParameters.