Houdini 22.0 Nodes APEX nodes

array::Slice<T>

Extracts a slice from an array.

On this page
Since 22.0

Extracts a slice from an array between the start and end indices, given a step size.

Tip

A start or end value of -n indexes the nth last element of the array.

Inputs

array: ApexNodeIDArray, ApexPortIDArray, BoolArray, DictArray, DynamicPathArray, FBIKSkeletonArray, FBIKSolverArray, FBIKTargetArray, FloatArray, GeometryArray, IntArray, Matrix3Array, Matrix4Array, SimRootDataIdArray, StringArray, Vector2Array, Vector3Array, Vector4Array

The input array.

usestart: Bool

If set to True, uses the start index. If set to False and step is positive, the slice starts at the beginning of array. If set to False and step is negative, the slice starts at the end of array - 1.

start: Int

The index of the first array element to add to the slice. If negative, the length of array is added to start.

useend: Bool

If set to True, uses the end index. If set to False and step is positive, the slice stops at the end of array. If set to False and step is negative, the slice stops at the beginning of array (steps backward to the beginning of array).

end: Int

The end index of the slice. The slice stops one index before it reaches end. If negative, the length of array is added to end.

Note

If end is 0 and step is negative, the first element of array is excluded from the result.

If end is -1 and step is negative, an empty array is returned. In this case, it is recomended instead to set useend to False.

step: Int

The increment between indices of array elements to include in the result. Defaults to 1. For example, if step is 2, the result includes every second element in array. If step is negative, start must be greater than end.

Outputs

result: ApexNodeIDArray, ApexPortIDArray, BoolArray, DictArray, DynamicPathArray, FBIKSkeletonArray, FBIKSolverArray, FBIKTargetArray, FloatArray, GeometryArray, IntArray, Matrix3Array, Matrix4Array, SimRootDataIdArray, StringArray, Vector2Array, Vector3Array, Vector4Array

The slice extracted from the input array.

See also

APEX nodes