Arrays may have different sizes for different members of the same data set. For example, Get Closest Points may return a different number of locations for each position depending on how many points are within the cutoff distance.
Many of the basic nodes support arrays in addition to single values, including nodes in the Math and Conversion categories. There is also a set of nodes that allow building and modifying arrays; for example, the Push On Array node adds a value at the end of the array. There are also nodes that access array attributes such as the size of the array, the average of the values, etc.
However, if you know the maximum size that the array will grow to in advance, you can improve performance by using the Reserve Array node to reserve memory for it, for example, in a separate ICE tree earlier in the construction stack that does not get re-evaluated during a simulation. You can also use Reserve Array to reserve additional memory for existing arrays. For example, if you are about to push four items into every array in a data set, it may be more efficient to reserve the memory first. Reserving memory does not change the size of arrays.
In addition to using the Insert in Array node to insert a value into an array, you can use it to insert an array into another array. This is like splicing one array inside another beginning at the specified index.
Sort Array with Key sorts one array based on another of the same size. It is similar to sorting the rows of a table or spreadsheet based on one of two columns — the other column is rearranged in the same way.
The Get Array Sub Indices node simply returns an array of the integer indices used by another array. This is typically used with Sort Array with Key. For example, if you have an array of deformers and an array of point weights and you want to get the two deformers with the strongest influence, you can get the indices of the deformer array, sort it according to the point weight array (using descending order), and then return the first two indices.
If you use invalid index values with the array nodes, such as index values that are negative or that are greater than or equal to the array size, then the result is filtered. In some cases, for example when using Set in Array, this can result in the entire array being filtered for those elements in a data set.
You can combine arrays with single values. For example, adding a single scalar value to an array of scalars adds the value to every item in the array. Similarly, muliplying an array of vectors by a scalar multiplies every vector in the array by the scalar.
When combining arrays using operators, for example, when adding, multiplying, or comparing arrays, the operation is performed item by item. For example, when adding two arrays, Value1 is added to Value2 to give Result, Value1 is added to Value2 to give Result, and so on.
If the arrays are of different sizes, any "overflow" is filtered and the output is the same size as the smallest input array. The same is true for the If node when the Condition, If True, and If False inputs are arrays of different sizes, and for the Select Case node when its inputs are arrays of different sizes.
If you use more than one 2D array on an object, you must rename these attributes in the Build 2D Array compound and make the corresponding name changes in the other compounds that work with 2D arrays. Otherwise, the different 2D arrays will overwrite each other. Apart from that, you can use the Array2d compounds without worrying about how they work internally.