I would like to do a little counter to avoid doing geometry queries (as in give me all the points in the cloud, filter on the condition and get the final array size), so basically increment some counter when a particle is in a given state, and decrement it whenever it dies or goes to another state.
Is there a way to do that? I did create a new parameter on an object in the scene (using anim>create>parameter) and was planning of doing for each particle that meets the condition a simple: get data (obj.counter) -> add ( 1 ) -> set data(obj.counter) -> if ( condition on particle ) -> ICE Tree.
Well it seems I cannot do the connection between the setData and the IF. The IF context is a given point on the cloud, and it seems that the set data scope requires to be the Object (which I imagine means run once per simulation step?). Is it due to the fact that setters on global object are forbidden due the parallel processing (as to prevent race condition?) or is it just me missing something
Any help appreciated while I keep digging...
Thanks!
Claude