vfortin
08-22-2006, 01:44 PM
Hi eveyone,
I have an arrayMapper providing a particle object with an array of values. Just like it does when you connect a ramp to a PP attribute.
The size of the arrayMapper.outValuePP is equal to the number of particles no matter how many particles die during the simulation.
That means that the array is constantly updated and, more important, the position occuped by a particle in the array will change to fill the space left by a dying one.
As you can imagine, the order of IDs quickly becomes thrown into disarray and almost impossible to follow unless you keep track of all particles died and newborns.
But Maya does it, it seems, under the hood.
For example, when you type this in a particle expression:
particleShape1.radiusPP = particleShape1.myArrayPP
Maya knows right-away which index of the array the current particle ID is reffering to even if the array order has changed during the previous simulation frame. Go figure how, that's what I'm looking for.
I'm asking this because I'm working with MEL commands within particle expressions.
I'm using something like this `getAttr(particleShape1.myArrayPP[$x])`, $x being the index in the array occupied by the currect particle.
Hopefuly someone here has gone throught this before me.
Is there some kind of formula out there to keep track on this without too much calculation overhead?
Thanks
Vincent
I have an arrayMapper providing a particle object with an array of values. Just like it does when you connect a ramp to a PP attribute.
The size of the arrayMapper.outValuePP is equal to the number of particles no matter how many particles die during the simulation.
That means that the array is constantly updated and, more important, the position occuped by a particle in the array will change to fill the space left by a dying one.
As you can imagine, the order of IDs quickly becomes thrown into disarray and almost impossible to follow unless you keep track of all particles died and newborns.
But Maya does it, it seems, under the hood.
For example, when you type this in a particle expression:
particleShape1.radiusPP = particleShape1.myArrayPP
Maya knows right-away which index of the array the current particle ID is reffering to even if the array order has changed during the previous simulation frame. Go figure how, that's what I'm looking for.
I'm asking this because I'm working with MEL commands within particle expressions.
I'm using something like this `getAttr(particleShape1.myArrayPP[$x])`, $x being the index in the array occupied by the currect particle.
Hopefuly someone here has gone throught this before me.
Is there some kind of formula out there to keep track on this without too much calculation overhead?
Thanks
Vincent
