CGTalk > Software > Autodesk Maya > Maya Dynamics
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-28-2013, 08:05 PM   #1
FyreFlare
Frequenter
portfolio
FyreFlare
United%2BKingdom
 
Join Date: Nov 2012
Posts: 111
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:
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;

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?
Thanks

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-28-2013 at 09:21 PM.
 
Old 02-28-2013, 08:05 PM   #2
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

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


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