Expression help, lifepsan0 after opacity1

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
  02 February 2013
Expression help, lifepsan0 after opacity1

hi, looking at an expression that im stuck with;
Im attempting to have particles be killed after a certain amount of time, once their opacity is 1:
int $query=30; int $rand1=floor(rand(0,2));
    if(frame % $query==1)nParticleShape1.opacityPP=$rand1;
     if (nParticleShape1.opacityPP==1) nParticleShape1.lifespanPP=0+3;

It kind of works, however some particles are being killed before they are visible(their opacity is 1), and some are not lasting the designated +3.
Would be great if someone could take a look?

Edit: Ah worked out the issue regarding the particles no lasting; a particle is visible and going through its +3 but if there is a division of 30 in that time which returns a value of 0 the particle will become transparent before its time. Now a solution? Still unsure why they are sometimes being killed before they are visible.
Edit2: When the opacity is hitting one the lifespan of the particle becomes 3 from when it was born, not from when it's opacity became one..hmm
Edit3: just realised should this be in scripting - sorry if thats the case.

Last edited by FyreFlare : 02 February 2013 at 09:21 PM.
  02 February 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed 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 09:44 AM.

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