Array question

Discussions about SOFTIMAGEs© Interactive Creative Environment©
User avatar
rray
Moderator
Posts: 1810
Joined: 26 Sep 2009, 13:51
Location: Bonn, Germany

Array question

Post by rray » 27 Feb 2014, 14:47

Is there a way to get a "grouped" sum array like this without a repeat loop, for any size of group?

[ 0, 3, 7, 22, 6, 71, 1, 0, 9 ]
-> [ 0+3+7, 22+6+71, 1+0+9 ]
-> [ 10, 99, 10 ]

Group size (here 3) would go as an input into the compound
Cheers
-rr
softimage resources section updated Sep 26th 2026

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Array question

Post by Mathaeus » 27 Feb 2014, 15:36

Should be, by using separate array, array size equal to group size, indices of that array for selecting in original array. For next group, indices + size of previous group, or something like.
I think I was able to get separate result for strand array, in similar way. ID of strand segment as size of new array, used for selection.
Now I have no idea how to automate this, without using loop - but, if size of group is always the same, should be possible to go with some modulo/divide trickery.

User avatar
rray
Moderator
Posts: 1810
Joined: 26 Sep 2009, 13:51
Location: Bonn, Germany

Re: Array question

Post by rray » 27 Feb 2014, 16:08

Thanks Anto, it would have to work for any number of groups too, so I probably won't get around coding something.
Trying to figure out the most general purpose design of the node. Maybe it could cover cumulative sums too.
softimage resources section updated Sep 26th 2026

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Array question

Post by xsisupport » 27 Feb 2014, 17:41

You can do somethingwith Generate Sample Set.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
rray
Moderator
Posts: 1810
Joined: 26 Sep 2009, 13:51
Location: Bonn, Germany

Re: Array question

Post by rray » 27 Feb 2014, 18:15

Hey thanks Steve! Nice, never occured to me that a set doesn't have to represent something in the scene.
I'll still do an attempt to write the custom node and if I'm successful do some performance tests of the two methods.
softimage resources section updated Sep 26th 2026

User avatar
rray
Moderator
Posts: 1810
Joined: 26 Sep 2009, 13:51
Location: Bonn, Germany

Re: Array question

Post by rray » 27 Feb 2014, 23:52

Did this https://www.si-community.com/forum/v ... =19&t=4936
I can't do the 'announced' performance test with big point clouds because I can't seem to get the GenSampleSet setup working with per point contexts.
softimage resources section updated Sep 26th 2026