PDA

View Full Version : Assigning setRangeX output to particle position


Aikiman
09-24-2009, 09:11 PM
Hey ppl,

Im attempting to force the output value of a setRange node into a couple of per particle attributes and getting some but not perfect success here. Using the following code..



int $setRangeX = `getAttr setRange1.outValueX`;
vector $pos = position;
setParticleAttr -at position -vv ($pos.x) ($setRangeX) ($pos.z) curve1ParticleShape.pt[$setRangeX];



The good part is that it works on position but not on a per particle level. All the particles end up in the same worldPosition whereas as I want the setRange to decide which particle to affect also.

Aikiman
09-25-2009, 12:08 AM
I found a workaround which will do for now.


int $setRangeX = `getAttr setRange1.outValueX`;
vector $pos = curve1ParticleShape.position;
if (curve1ParticleShape.particleId == $setRangeX)
curve1ParticleShape.position = <<($pos.x), ($setRangeX), ($pos.z)>>;

CGTalk Moderation
09-25-2009, 12:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.