PDA

View Full Version : How to sum up array values


Kai
08-11-2008, 01:52 PM
Hi,
I build a tree to calculate a weight map based on a null. Now instead of using one null I want to plug in a group to have a more general tool. However I need to sum up the influences on the weightmap of all group members and then use a Set Data to write the result to the map. When I loop over the values I need some kind of helper variable to store the results since I can not use Get Data on the weight map.
Is it possible to do something like this at all?

Cheers,
Kai

StephenBlair
08-11-2008, 02:34 PM
Can you use an attribute?

Kai
08-11-2008, 03:02 PM
Thanks for the hint Stephen.
Dynamic attributes seem to do the trick. I check it now in a more complex context.

Kai

thiago
08-11-2008, 04:50 PM
hey Kai,
You can use the Set Data and type your new attribute in there like Self.myattribute.
And then store whatever you want in there.

Or just to Sum the entire array you can use the Array Sum (or something like that).

Kai
08-12-2008, 04:42 AM
Hi Thiago,
I needed to use a custom attribute - works just fine.

Cheers,
Kai