Set Array Index
Creates a copy of an input array where an index-specified element has been given a new value. Positive indices index from the front of the array, while negative indices index from the back of the array. “Index” values in the domain [-arrayLength, arrayLength) will always be valid for this node type. If “Resize to Fit” is true and “Index” >= arrayLength, then the output array will be resized to length 1 + “Index” and fill the new spaces with zeroes before applying the new element value.
Installation
To use this node enable omni.graph.nodes in the Extension Manager.
Inputs
Name |
Type |
Descripton |
Default |
---|---|---|---|
Array (inputs:array) |
|
The array that serves as the starting point for the modified output array. |
None |
Index (inputs:index) |
|
The index of the element that should be modified in the output array. Indices in the domain [0, arrayLength) correspond to the usual element locations in the array, e.g. an “Index” of 2 equates to the third element in the array. Indices in the domain [-arrayLength, 0) correspond to array indexing starting from the back of the list, e.g. for an array of size 5, an “Index” of -5 equates to the last element in the array (i.e. the element at position 4), an “Index” of -4 equates to the second-to-last element in the array (i.e. the element at position 3), etc. Attempting to execute this node with “Index” values outside of the [-arrayLength, arrayLength) domain will result in a runtime error, unless “Index” >= arrayLength and “Resize to Fit” is set to true (see the “Resize to Fit” attribute description for more information). |
0 |
Resize To Fit (inputs:resizeToFit) |
|
When true and the given positive index “Index” is larger than the size of the the input array, resize the output array to length 1 + “Index”, and fill the new spaces with zero values. |
False |
Value (inputs:value) |
|
The value to set at the given “Index” in the output array. |
None |
Outputs
Name |
Type |
Descripton |
Default |
---|---|---|---|
Array (outputs:array) |
|
A copy of the input array whose index-specified value has been set to “Value”. |
None |
Metadata
Name |
Value |
---|---|
Unique ID |
omni.graph.nodes.ArraySetIndex |
Version |
1 |
Extension |
omni.graph.nodes |
Has State? |
False |
Implementation Language |
C++ |
Default Memory Type |
cpu |
Generated Code Exclusions |
None |
uiName |
Set Array Index |
Categories |
math:array |
Generated Class Name |
OgnArraySetIndexDatabase |
Python Module |
omni.graph.nodes |