Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 01-03-2013 , 01:04 PM
Registered User
Join Date: Mar 2013
Posts: 1

Expression help - Kill particle after nFrames of opacity

Hello, first post here, so hope im in the right place.
So im trying to create an expression that will randomise when particle opacity will occur, and in addition once opacity reaches one the particle be killed so many frames later.
Ive tried two ways so far and neither work entirley
1:
Code:
int $query=30; int $rand1=floor(rand(0,2));
if(frame % $query==1)nParticleShape1.opacityPP=$rand1; 
if (nParticleShape1.opacityPP==1) nParticleShape1.lifespanPP=0+3;
The problem with this is that if the query can return a value of 0 before the particle dies. And that the lifespan will be 3 from when it was born, not from when the opacity reached one.
2:
Code:
int $offset=30;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime + $offset;

int $query=30;
int $rand1=floor(rand(0,2));
if(frame % $query==1)nParticleShape1.opacityPP=$rand1;


if (nParticleShape1.opacityPP==1)
{
if ($currentTime>$offsetTime)nParticleShape1.opacityPP=0;
}
This dosnt work either. Which makes me think this perhaps isn't the best way of going about this.
Would be great if anyone could help - thanks user added image

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads