View Full Version : How can I freez only ParticleShape.Position X and Z in Maya

 rkom06 June 2008, 08:30 AMI want to freez particleShape.positionX and Z with expression. ( ignore for Y position ) after particle born. because I need each particles must not move along X and Z axis after add Fields effect. Thank alot pardon me for English Language.
Aikiman
06 June 2008, 10:12 AM
You can control a particle position using this expression....

vector \$pos = position;
position = <<\$pos.x, \$pos.y+sin(time), \$pos.z>>;

this will hold your particle's birth position and animate it's y attribute using sin of time.

rkom
06 June 2008, 05:27 PM
You can control a particle position using this expression....

vector \$pos = position;
position = <<\$pos.x, \$pos.y+sin(time), \$pos.z>>;

this will hold your particle's birth position and animate it's y attribute using sin of time.

thank you for example

but when nurbs ball moving to particles ( nurbs ball was collide object ) any particles still move to anywhere ( X, Y, & Z axis ).
Really, I would like every particles don't moving along X and Y axis after collided .

have any expression else?

thank a lot and pardon me English language.

Aikiman
06 June 2008, 08:38 PM
Try this where the particles only move in the Y direction after collisions.
Create a custom particle per particle vector attribute called "originalPos" then add these dynExpressions...

// Creation expression
particleShape1.originalPos = particleShape1.position;

// Runtime expression
vector \$origPos = particleShape1.originalPos;
vector \$pos = particleShape1.position;
if ((\$pos.x != \$origPos.x) || (\$pos.z != \$origPos.z))
particleShape1.position = << \$origPos.x, \$pos.y, \$origPos.z>>;

Basically all you are doing is creating a custom attribute that will hold the original position and if the position in x or z changes, then make the particle return to the original position.

rkom
06 June 2008, 03:27 AM
Try this where the particles only move in the Y direction after collisions.
Create a custom particle per particle vector attribute called "originalPos" then add these dynExpressions...

// Creation expression
particleShape1.originalPos = particleShape1.position;

// Runtime expression
vector \$origPos = particleShape1.originalPos;
vector \$pos = particleShape1.position;
if ((\$pos.x != \$origPos.x) || (\$pos.z != \$origPos.z))
particleShape1.position = << \$origPos.x, \$pos.y, \$origPos.z>>;

Basically all you are doing is creating a custom attribute that will hold the original position and if the position in x or z changes, then make the particle return to the original position.

Oh Great !
I just modified this expression a liitle bit, then it's work fine.

Thank a lot

CGTalk Moderation
06 June 2008, 03:27 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.

1