It is currently 24 Jun 2017, 02:08

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: 3 new Array ICE nodes
PostPosted: 28 Feb 2014, 01:49 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 1282
Location: Bonn, Germany
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-summing-up-array-elements-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 283 times

_________________
Image rray.de, a resource site for softimage, updated Oct 15th 2016


Last edited by rray on 15 Aug 2014, 15:51, edited 3 times in total.
bugfix (float values did get rounded to integers)
Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 01 Mar 2014, 15:29 
Offline
Moderator

Joined: 24 May 2012, 09:44
Posts: 2247
Thanks. Now to learn about arrays.


Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 19 Nov 2014, 10:26 
Offline

Joined: 25 Jun 2009, 00:21
Posts: 15
super useful nodes!


Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 19 Nov 2014, 18:22 
Offline

Joined: 27 Aug 2010, 22:25
Posts: 480
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.


Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 19 Nov 2014, 19:14 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 1282
Location: Bonn, Germany
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 123 times

_________________
Image rray.de, a resource site for softimage, updated Oct 15th 2016


Last edited by rray on 20 Nov 2014, 03:15, edited 2 times in total.
added some comments to the tree
Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 20 Nov 2014, 04:51 
Offline
User avatar

Joined: 19 Jun 2012, 21:59
Posts: 748
RRay walks around with a box full of tools :)


Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 21 Nov 2014, 02:56 
Offline
User avatar

Joined: 19 Jun 2012, 21:59
Posts: 748
A magic bag of tricks =)


phpBB [video]


"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, 04:02, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 21 Nov 2014, 03:10 
Offline
Moderator
User avatar

Joined: 26 Sep 2009, 15:51
Posts: 1282
Location: Bonn, Germany
haha I should make a site for collecting all these tools xD
Let me think about this question!

_________________
Image rray.de, a resource site for softimage, updated Oct 15th 2016


Top
 Profile  
 
 Post subject: Re: 3 new Array ICE nodes
PostPosted: 21 Nov 2014, 03:21 
Offline
User avatar

Joined: 19 Jun 2012, 21:59
Posts: 748
lol! =)

Also this
phpBB [video]

Sports RRay =)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group