PDA

View Full Version : Expression for sprites


optimus008
01-26-2008, 10:48 PM
Hi all

I'm want to create an expression to control sprites that at birth grow then shrink a little then grow back to a set size. I'm trying to make a kind of squash and stretch effect when their born.
But don't know how to achieve it. I only now basic expressions.

I was thinking of using scalarPP, but don't know if I should just focus on sprite scale.

So any help would be awsome.

optimus008
01-27-2008, 01:20 AM
So I think I have a way but it won't let me run an if (frame =)
particleShape1.spriteScaleYPP += .001;

So I can get the sprites to grow in the Y direction at birth, but how do I get the sprites to go back to a set Y size.

I was trying to use time but I guess it won't work with SpriteScaleYPP.

tbaypaul
01-27-2008, 02:39 AM
after you create the spriteScalePP attributes just right click the PP attributes and make a ramp with the particle's age as the v coordinate...ramp is blackish at bottom then whitish then blackish then white...works fine here.......using maya2008

axiomatic
01-28-2008, 05:25 AM
tbaypaul is right, ramps are good for this.

if you wanted to do it with mel / expressions you'd set your 'base scale' as a variable in the first line of your expression, then each frame you'd change the individual scales by iterating up (something like spriteScaleXPP = spireScaleXPP + 1; or perhaps, spriteScaleXPP = baseScale + frame;) and using some control statements to bring it back down.

its worth getting very familiar with variables :)

optimus008
01-28-2008, 05:00 PM
Thanks

axiomatic and tbaypaul

I'll have to incorperate both of your techqunics in my simulation.

CGTalk Moderation
01-28-2008, 05:00 PM
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.