Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Changing particle radius with expressions

From: Maya Particle Effects

Video: Changing particle radius with expressions

In this section we will deal with expressions to change the radius of particles. You can see I have a basic setup going here in my directional emitter along the X axis, a little bit of spread again. See it's looking like that. You can see the size of the particles are all the same and that's because I'm getting the size from the current render type, the Radius is 0.330 for all of them. I have expressions for Lifespan and a little bit of variation in the Lifespan expression. Random between 10 and 12 and I have a ramp on the color.

Changing particle radius with expressions

In this section we will deal with expressions to change the radius of particles. You can see I have a basic setup going here in my directional emitter along the X axis, a little bit of spread again. See it's looking like that. You can see the size of the particles are all the same and that's because I'm getting the size from the current render type, the Radius is 0.330 for all of them. I have expressions for Lifespan and a little bit of variation in the Lifespan expression. Random between 10 and 12 and I have a ramp on the color.

So you can see the color of this. Particles born with this color and when they die, they are this color. So now what I want to add though is an expression for the Radius of these particles, so I am going to go down and look for something under the Per Particle Attributes and I notice that there is none. So I am going to hit the General button so that I can create an attribute for the Radius, a Per Particle attribute. And I am going to hit the Particle tab here and look at all of these wonderful things you can play around with. But we are just going to take the radius per particle and create an attribute for that. I am going to Add and there it is, my Radius Per Particle. I am going to click on it and I am going to do Create Ramp there.

Let's edit the ramp. Once again in Maya, colors have numbers. Wite would be 1 and black would be 0. So you can see that my particles when they are born, they will be one unit big. When they die, they will be zero. You know it's big, you can see they are right here. Let's play it. You will see what happens to them. Look, they start out big and they get small back there. So that's one way, one simple way that I could change the radius of my particles just by controlling these numbers. I am going to click in here and you can see, RBG, they are all one, or I can also do it HSV and just play with the value here. And watch what I do. If I make this value higher than 1, I am going to make it 5 and we are going to go Accept, look what just happened.

Because you can actually make white higher than 1. You can give it a higher value. Though we all know that the full value of a color, to get the full saturation of a color, it only goes from 0 to 1 but you can change the numbers to be higher than that except.. Let's play with that. You can see that's what you have right now, kind of fun looking. Let's change our radius in another way. And so I am going to go into the Radius Per Particle, going to hit the array and I am going to go Break Connection to get rid of the ramp from there. I have right clicked in there and go Break Connection so there is no longer anything on that Radius Per Particle. Now I am going to create an expression for it. I will do a Creation Expression.

Let's make them right here which you will see once again, put it down here, under the creation area, Ctrl+V, equals. Let's do a random expression, we like random expressions, and have them go random when they are born. They are going to be all kinds of random sizes when they are born and let's make them being born from anything from .1 to 2. That will show big size difference there when they are born and they first come out of the emitter. So I am going to go Edit. Let's see what we have now. They are coming out in all kinds of different sizes. It might not be that easy to see in this.

Let's try that again. You can see a tiny little one right there, for example, and some other little ones right there. Let me go into that expression and make it not so big. Let's make it .1 to like .8, so you can see a little bit better here. Edit. And they are being born at different sizes. So now hopefully you will get a better look. And their whole life they are staying whatever size they are born. Here is a little particle, they are different sizes and they are staying whatever size for their entire existence. They live and die the same size.

So now let's do something where I want them over time to change size. Let's try something where I am going to influence the particles' runtime before dynamics. This means that as the particles are playing their radius is going to be changing. If I was to do Creation the radius of the particles would be different sized when they are born. This time their radius is going to be changing as they are running in time. So I am going to make an expression for that and I will show you the difference.

I will make this radius per particle equals 0.2 times time. Now time is an interesting thing here because what times means is, remember we said that 1 equals 24 frames, so when this particle has lived for 24 frames, it will be one unit big because the time will be 1. When it has lived for 48 frames, it will be 2 units big but it will actually be, at 24 frames, it will be 1 times 0.2.

At 48 frames it will be 2 times 0.2. That will be the size of the particles. So I am going to create that here. I am going to go look at my creation size for my radius and you see that my particles are being born at somewhere randomly between 0.1 and 0.8. I am going to just do away with this Creation Expression here, so they are just going to be ruled by the runtime expression. I am going to just delete it and then I go Edit and then that expression is deleted.

Okay, so let's see what happens now with our particles. And you can see as time passes, the particles get bigger and bigger because this is what is happening. As time increases, as they live longer, they are getting bigger and bigger, right. Select our Runtime before dynamics. 0.2 times time, so when they are 24 frames, time's would be 1 times 0.2. When they have lived for 48 frames the value of time would be 2 times 0.2. Obviously, right in the beginning, the first frame they are only -- time is 124th, right, times 0.2 and that's the size they are initially born at. Time goes on, they get bigger and bigger and that's what happens.

So I am going to now show you the difference. Let's do that as a Creation Expression. I am going to copy that, Ctrl+C and let's just Backspace it, get rid of it and go Edit. So if it's gotten rid of, go into the creation part, Ctrl+V, going to go to Edit. So I have added to the set of creation expressions I have here and let's go back and let's see what happens now. Look at this, okay. Since it's a creation expression, as times goes on the particles are born at a bigger and bigger size. But they stay whatever size they were born at for their whole life. So these particles being born earlier are very tiny. But the particles that are born later are very large. These are some simple templates you can play with to influence the radius per particle.

Show transcript

This video is part of

Image for Maya Particle Effects
Maya Particle Effects

26 video lessons · 6923 viewers

Audri Phillips
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Maya Particle Effects.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.