pscale, ramping up and down

   10939   5   2
User Avatar
Member
63 posts
Joined: July 2005
Offline
I have a pscale problem I am trying to figure out. Here is my situation and what I want to do.

I am shooting out some particles and they all have a lifespan of 5 seconds (24fps). I am trying to make the particles' pscale start at 0 at $LIFE==0, then grow to 1 by the time $LIFE==1. Then the pscale will remain at 1 until $LIFE==4, where the pscale will then start to shrink back down to 0 by $LIFE==5, or death.

Can anyone help me figure out this pscale expression?

-jon
User Avatar
Member
63 posts
Joined: July 2005
Offline
Whoops! I forgot that $LIFE is always a value between 0 and 1. What I meant in my question is $AGE. Here it is corrected:

I am shooting out some particles and they all have a lifespan of 5 seconds (24fps). I am trying to make the particles' pscale start at 0 at $AGE==0, then grow to 1 by the time $AGE==1. Then the pscale will remain at 1 until $AGE==4, where the pscale will then start to shrink back down to 0 by $AGE==5, or death.

-jon
User Avatar
Member
63 posts
Joined: July 2005
Offline
I figured it out:

if($AGE>=0 && $AGE <=1,clamp($AGE,0,1), if($AGE>=4 && $AGE<=5,5-$AGE,1))

Once I remembered the difference between $AGE and $LIFE, it clicked.

-jon
User Avatar
Member
112 posts
Joined: July 2005
Offline
if($AGE>=0 && $AGE <=1,clamp($AGE,0,1), if($AGE>=4 && $AGE<=5,5-$AGE,1))

I was wondering:

Is this expression entered into the pscale field of a Property POP?

Also, does the expression actually create a smooth ramping effect when the particle gets bigger?

The “if” statement says as long as the particle age is within the first second, clamp its scale between 0 and 1….once the condition is no longer true ($AGE > 1), evaluate the second “if” statement, right?


It does seem the second “if” statement would actually create a deceasing scale ramp as the particle ages. However, since you want the particle to shrink and disappear, wouldn't you put “0” instead of “1” for the false return value of “if($AGE>=4 && $AGE<=5,5-$AGE,1)”?
www.tirgari.com
User Avatar
Member
63 posts
Joined: July 2005
Offline
Yes, that is where it can be entered. Depending on what you prefer, you can either enter it at the pop level, or you can append a point sop after your popmerge sop and enter it there, but you still need to add a property pop. So I just save a step and do it at the POP level.

It does create a smooth ramping effect when getting bigger. Based upon the expression, a particle's scale is the same value as its age, until it hits $AGE==1. Because of the clamp, it will stay at one and grow no larger or smaller, until later on in the expression when the second “if” statement appears. it tells the particle to start shrinking back down to 0: (5-$AGE). As for the 1 in the false return, I just did it to be safe. Regardless, it works.

Understand now?

-jon
User Avatar
Member
112 posts
Joined: July 2005
Offline
Cool… 8)
www.tirgari.com
  • Quick Links