Adverti horiz upsell
Using Expressions in Maya 7: goalWeight and goalWorldPositionPP.
Using Expressions in Maya 7: goalWeight and goalWorldPositionPP.
robotball, added 2005-10-10 11:43:09 UTC 55,010 views  Rating:
(1 rating)
Page 4 of 4

Here's the expression:

if ((abs($pos-$goal0Pos)<$distance0)||(abs($pos-$goal1Pos)<$distance1))

particleShape1.velocity=$velo;

vector $velo=particleShape1.velocity;

27. In the end the new runtime espression looks like this:

vector $goal0Pos=particleShape1.goalWorldPosition0PP; vector $goal1Pos=particleShape1.goalWorldPosition1PP;

vector $pos=particleShape1.position;

float $range0=.5*freezeField0.fieldSize;
float $range1=.5*freezeField1.fieldSize;

vector $distance0=<<$range0,$range0,$range0>>;
vector $distance1=<<$range1,$range1,$range1>>;

vector $velo=particleShape1.velocity;

if ((abs($pos-$goal0Pos)<$distance0)||(abs($pos-$goal1Pos)<$dista nce1))
$velo=0;

particleShape1.velocity=$velo;

Play the animation and make sure both freeze fields are working. once again, it ain't stellar demo tape material but you should be able to see how these techniques could be useful in more complex animations.

Try turning the goal weights on by setting the goal weights to small numbers in the creation expression. Or use the conditional statement to change a different attribute than velocity. Try radius or acceleration.

Hope this has been helpful. Email me if you have questions and enjoy Maya 7.