3 new Array ICE nodes

Plugins linking to this thread: (hide)

Most Common Array ElementAuthor: Reinhard Claus
Returns the most common element from an array. Works in object and per component context. Can be modified to find the second most common element and so on. Compound screenshot.

local backup: Get Popular Number.xsicompound
ICE Array NodesAuthor: Reinhard Claus
A set of ICE nodes for some array operations that are not possible to recreate using factory nodes. Examples are: grouped sums, cumulative sums and operations on 'fake' 2D arrays (=linearized to a normal array).

Includes (from the si-community thread): Get Grouped Sums Array - groups values from an input array in a specified pattern and outputs the group sums as a new array. It can also do cumulative sums. If you're not working in a subcomponent context, you can also try this approach using GenerateSampleSet. Get Grouped Products Array - Same for products of array entries... uses cross product for vectors - Get Cumulative Sums Array - This one is a convenience node that does what is shown in example #4. It contructs the group sizes array based on the input array and output the cumulative sums array [A1, A1+A2, A1+A2+A3, A1+A2+....] - Get Repetition Array - This is a simple compound that creates repetions of an array, number of repetions is configurable of course. It is used to prepare a normal array for an operation with a 'fake' 2D array.

See the si-community thread for a few examples. A more complicated example is interpolating strands by nearby guide strands. Problem here: 'Get Closest Points' returns an array of the closest points and a 'Get StrandPositions' on this would require native 2D array support which does not exist. Workaround possible with these nodes: Build a global GuideStrandPositions array by concatenating the Guides' StrandPositions and store each guide's offset into this array as an attribute on the guide. The example scene demonstrates how to use this plugin to calculate the interpolated strands from this array.

local backup: ICEArrayNodes.xsiaddon CurvesAsGuides_Example_2014SP1.scn

Post Reply
User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

3 new Array ICE nodes

Post by rray » 28 Feb 2014, 00:49

Get Grouped Sums Array
Image

adds up groups of values from the input array and outputs the group sums as a new array. It can also do cumulative sums. If you're not working in a subcomponent context, you can also try this approach using GenerateSampleSet: http://xsisupport.com/2014/02/27/ice-su ... -of-group/

INPUTS
---> Input Array: The input array that gets read from for the additions (allows per subcomponent, object contexts and as datatype: vector, scalar, integer, quat, color)
---> Group Size(s): The number of elements in each "addition group". Can be an array.
---> Increment: Steps to take to find "next" group element to add. Usually 1 but other values can make sense, see examples.

OUTPUT
---> Result Array: Output array of the sums of the individual groups. Get set to the same datatype and context as the Input Array.

EXAMPLES

// Example 1: groups of 4
Input Array: [2,3,0,5,0,1,2,3,1,5,5,5]
Group Size: 4
Increment: 1
Result: [2+3+0+5, 0+1+2+3, 1+5+5+5]

// Example 2: groups of 3, every 4th element
Input Array: [2,3,0,5,0,1,2,3,1,5,5,5]
Group Size: 3
Increment: 4
Result: [2+0+1, 3+1+5, 0+2+5, 5+3+5]

// Example 3: differently sized groups
Input Array: [2,3,0,5,0,1,2,3,1,5,5,5]
Group Size: [1,5,2,4]
Increment: 1
Result: [2, 3+0+5+0+1, 2+3, 1+5+5+5]

// Example 4: cumulative sum
Input Array: [2,3,0,5,0,1,2,3,1,5,5,5]
Group Size: [1,2,3,4,5,6,7,8,9,10,11,12]
Increment: 0
Result: [2,5,5,10,10,11,13,16,17,22,27,32]

Get Grouped Products Array
Same for products of array entries... uses cross product for vectors

Get Cumulative Sums Array
Image

This one is a convenience node that does what is shown in example #4. It contructs the group sizes array based on the input array and output the cumulative sums array [A1, A1+A2, A1+A2+A3, A1+A2+....]

Get Repetition Array
Image

This is a simple compound that creates repetions of an array, number of repetions is configurable of course:

// Example #1:
Input Array: [2,3,0]
Nb Repetitions: 3
Repeat Full Array: True
Result: [2,3,0,2,3,0,2,3,0]

// Example #2:
Input Array: [2,3,0]
Nb Repetitions: 3
Repeat Full Array: False
Result: [2,2,2,3,3,3,0,0,0]

enjoy and please report any bugs/ideas!
-rr
Attachments
ICEArrayNodes.zip
(21.33 KiB) Downloaded 529 times
Last edited by rray on 15 Aug 2014, 15:51, edited 3 times in total.
Reason: bugfix (float values did get rounded to integers)
softimage resources section updated Jan 5th 2024

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: 3 new Array ICE nodes

Post by Bullit » 01 Mar 2014, 14:29

Thanks. Now to learn about arrays.

imding
Posts: 15
Joined: 25 Jun 2009, 00:21

Re: 3 new Array ICE nodes

Post by imding » 19 Nov 2014, 09:26

super useful nodes!

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: 3 new Array ICE nodes

Post by Pooby » 19 Nov 2014, 17:22

Thanks for these.. I am trying to think of a use for them.
(that sounded slightly like I'm implying that they are not useful, but thats not what i mean at all. THey are the kind of thing that will be just the ticket one day I'm sure)
Is there a way of finding (in per point context) the most common number in an array without a repeat loop? that would be useful to me right now.

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: 3 new Array ICE nodes

Post by rray » 19 Nov 2014, 18:14

Thanks for your feedback!

Hey pooby-
Not this one, but another compound I wrote (remove duplicates) should help with that (see attachment)
Not tested a lot :-s

Image
Attachments
Get Popular Number.xsicompound
(16.61 KiB) Downloaded 348 times
Last edited by rray on 20 Nov 2014, 02:15, edited 2 times in total.
Reason: added some comments to the tree
softimage resources section updated Jan 5th 2024

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: 3 new Array ICE nodes

Post by FXDude » 20 Nov 2014, 03:51

RRay walks around with a box full of tools :)

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: 3 new Array ICE nodes

Post by FXDude » 21 Nov 2014, 01:56

A magic bag of tricks =)




"Tresspassing" => making something extremely versatile.

"Incredible!"

"I Must have it!"

Capturing/Reducing Felix

Now what philosophy (not 'who') could represent the professor?

(ps: the solution to bad philosophy isn't blows to the head ;] )
Last edited by FXDude on 21 Nov 2014, 03:02, edited 2 times in total.

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: 3 new Array ICE nodes

Post by rray » 21 Nov 2014, 02:10

haha I should make a site for collecting all these tools xD
Let me think about this question!
softimage resources section updated Jan 5th 2024

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: 3 new Array ICE nodes

Post by FXDude » 21 Nov 2014, 02:21

lol! =)

Also this

Sports RRay =)

jonmoore
Posts: 153
Joined: 30 Jul 2016, 18:18

Re: 3 new Array ICE nodes

Post by jonmoore » 18 Aug 2020, 22:30

Hey Ray, Spent some time digging through your Add Curve Guides compound today and finally grokked how the component parts of your Ice Array Nodes fit together for a gloriously intuitive strand grooming toolset. Nice work fella. B-)

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests