Array Access and Construction (SDK)

3DS Max Plug-In SDK

Array Access and Construction (SDK)

Arrays are useful for passing multiple values back and forth; there is no multiple-value return mechanism in MAXScript.

Arrays in MAXScript are dynamic and will grow as necessary (by a factor of 1.5 when needed). You can set the initial extent size on creation. Uninitialized elements are set to &undefined.

As with all Value creation inside C++ code, a freshly created array must be protected from garbage collection, either by placing it immediately inside some other protected value, or by using the protection macros described in the Protecting Newly Created Values from the Collector topic.

Array(int init_size); // constructor allocates initial array size

 

Value* append(Value*);

Value* get(int index);

Value* map(node_map& m);