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
Array question
-
rray
- Moderator
- Posts: 1810
- Joined: 26 Sep 2009, 13:51
- Location: Bonn, Germany
Array question
softimage resources section updated Sep 26th 2026
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Array question
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.
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.
-
rray
- Moderator
- Posts: 1810
- Joined: 26 Sep 2009, 13:51
- Location: Bonn, Germany
Re: Array question
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.
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
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: Array question
You can do somethingwith Generate Sample Set.
-
rray
- Moderator
- Posts: 1810
- Joined: 26 Sep 2009, 13:51
- Location: Bonn, Germany
Re: Array question
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.
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
-
rray
- Moderator
- Posts: 1810
- Joined: 26 Sep 2009, 13:51
- Location: Bonn, Germany
Re: Array question
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.
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