Maya nparticles stop rotation after collision

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  12 December 2017
Maya nparticles stop rotation after collision

hi guys
i have a simple nparticles been created with initial orient and rotation with some expressions , and the issue i is that on collision with the ground they keep on rotating.
i followed a tutorial online and i dont have alot of experience with expressions.
im using these expressions in the creation:
nParticleShape1.InitialOrient = <<rand(360),rand(360),rand(360)>>;
nParticleShape1.RotateFactor = <<rand(10),rand(10),rand(10)>>;
and in the after runtime:
nParticleShape1.InitialOrient += nParticleShape1.RotateFactor;


  12 December 2017
You could check if the velocity of the particles is below a certain value and turn rotation off if they are too slow.

Or you add the particles collisionTime attribute which is -1 if no collision occurred and turn off rotation if collisionTime is > 0.0.
__________________ -

Last edited by haggi : 12 December 2017 at 12:25 PM.
  12 December 2017
Thank you haggi!
I don`t know the syntax and i dont know code....
can you help me wright this?
  12 December 2017
Hi im having this problem as well , how can i stop the rotation with the relevant expression?
  12 December 2017
Okay, I try to explain:
- go to the nParticle shapes "Add Dynamic Attributes" and click on "Genreal"
- in the "Add Attribute" window go to the "Particle" tab and select "collisionTime" and click "OK"
- Now you have a new "collisionTime" attribute in the "Per Particle (Array) Attributes" list.

The "collisionTime" attribute will be filled automatically by Maya. You can check it if you select "Nunmeric" as "Particle Render Type" under "Shading" in the nParticleShape and set "collisionTime" in the "Attribute Name". Then all particles will have a -1 at start and as soon as they collide, the value starts to increase beginning from 0.

Now in the runtime expression where you increase the rotation, you can simply check for collisionTime like this (pseudocode):

if(collisionTime > -1)
do nothing
 increase rotation
__________________ -
  12 December 2017
thanks haggi this was very useful
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:13 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.