Hi there, this is my first post. I’m making a text animated using particles (wrote a word using nParticles and added a Volume Axis to move the particles), it’s working great, but I would like to know if I can destroy the particles separately based on its amount of movement.
For example, using MEL, get the start position of each particle and, when the distance is greater than “10” this particle is removed/destroyed. I have only two things in Outliner: particle1, volumeAxisField1 (the other things do not have any inffluence in my particle animation)
I know C++ and C#, but not MEL. Where can I found examples of MEL scripts? Is possible anyone show a generic code about what I wanna do? I would appreciate any help. My Maya version is 2020.
Hi there, this is my first post. I’m making a text animated using particles (wrote a word using nParticles and added a Volume Axis to move the particles), it’s working great, but I would like to know if I can destroy the particles separately based on its amount of movement.
For example, using MEL, get the start position of each particle and, when the distance is greater than “10” this particle is removed/destroyed. I have only two things in Outliner: particle1, volumeAxisField1 (the other things do not have any inffluence in my particle animation)
I know C++ and C#, but not MEL. Where can I found examples of MEL scripts? Is possible anyone show a generic code about what I wanna do? I would appreciate any help. My Maya version is 2020.
Ok I did.
In "particleShape1":
-> "Lifespan Attributes" -> Lifespan Mode: lifespanPP only
-> "Per Particle (Array) Attributes" -> Lifespan PP -> Right click and Create Expression...
--> In "Objects" select particleShape1
--> In "Attributes" select lifespanPP
--> Check "Runtime after dynamics"
--> In "Expression" use the code:
vector $pos = particleShape1.position;
float $dist = mag(<<$pos.x, $pos.y, $pos.z>>);
if ($dist > 32 ) lifespanPP = 0;
////////Now it's working
Ok I did.
In "particleShape1":
-> "Lifespan Attributes" -> Lifespan Mode: lifespanPP only
-> "Per Particle (Array) Attributes" -> Lifespan PP -> Right click and Create Expression...
--> In "Objects" select particleShape1
--> In "Attributes" select lifespanPP
--> Check "Runtime after dynamics"
--> In "Expression" use the code:
vector $pos = particleShape1.position;
float $dist = mag(<<$pos.x, $pos.y, $pos.z>>);
if ($dist > 32 ) lifespanPP = 0;
////////Now it's working
Can't find what you're looking for? Ask the community or share your knowledge.