# Line Step and Smooth Step

## Video: Line Step and Smooth Step

In this movie we are going to talk about this smoothstep function, a very useful function. And sometimes you just want to stipulate more exactly where you want a particle to start increasing or stop increasing or opacity to start and stop changing. With smoothstep it gives you this option. Smoothstep is a built-in function. Maya basically enters the value between 0 and 1 over a specified range. So you will have a smoothstep and you will have a start and an end and a unit parameter. And the smoothstep basically means that you are going from 0 to 1 from the start to the end of whatever unit parameter you have picked. To make this simpler I am going to start and make some expressions for you to see.

## Line Step and Smooth Step

In this movie we are going to talk about this smoothstep function, a very useful function. And sometimes you just want to stipulate more exactly where you want a particle to start increasing or stop increasing or opacity to start and stop changing. With smoothstep it gives you this option. Smoothstep is a built-in function. Maya basically enters the value between 0 and 1 over a specified range. So you will have a smoothstep and you will have a start and an end and a unit parameter. And the smoothstep basically means that you are going from 0 to 1 from the start to the end of whatever unit parameter you have picked. To make this simpler I am going to start and make some expressions for you to see.

So I am going to go to a Runtime Before Dynamics Expression for the Radius. And the first expression I am going to put in is I know that my Creation Expressions, I know I have my radius that's starting out at size 0.1. So I always want my particles to be at least size 0.1 for the Radius. So for this expression, what I am going to do is radius Shape1, copy it down here, equals 0.1 plus five times smoothstep. And I am going to have this start happening at frame 100, have it go to frame 500 and the unit parameter is frame. I am going to create this. No red down there. That means I did the right thing.

Okay, so essentially the particle is going to start out at 0.1 size radius and then I am going to go five times the smoothstep value, which will be going from 0 to 1 from frame 100. So the smoothstep value here will be 1 at frame 500 and it will be 0 at frame 100. So at frame 100 the particles will have a radius of 0.1 plus five times zero. And so they will have a radius of 0.1 and at frame 500 they will have a radius of 0.1 plus five times 1. So the biggest radius that these particles will get up to will be a radius of 5 plus 0.1.

Okay, so let's see what happens here. We can see that our particles start getting bigger. Go back and do that again and they are getting bigger and bigger. Let's make sure that I have this Animation Preferences. It's always important when you are working with particles to have the Playback Speed every frame. Save. And there they go again. And so let's do a little render of our particles. Let's see, there they are.

Now the next thing that I want to do is I want to change the opacity of these particles over time. So I am going to go into the Opacity Per Particle expression, a runtime expression. I am going to do equals 1 and I want their opacity to go down minus. So I want their opacity to decrease over a range of frames. I want the opacity to decrease from frame 100 to frame 400.

This is from the time our particle is born at frame 100. Or actually it's not. It's from frame 100 to frame 400 wherein the opacity of these particles is going to decrease, all of the particles, uniformly. I am going to edit that and it's telling me that I have a syntax error. We will add another bracket there and that should take care of that. Okay. So let's see what we have got going now. All right, so we are going to let ourselves get by to-- we said by frame 400, they should be completely transparent.

And look, there is nothing there at frame 400. Now I want to change that. I will go back a little bit. Let's show you that there is something there. For example at frame 200. Let's see what we got at frame 200. Look, we have some particles halfway transparent at frame 200. Okay, now I want the same thing to happen over the course of a particle's lifespan, not by frames, by Lifespan. So right now let's do a Runtime Before Dynamics Expression. I just want to see what my Lifespan is right now.

Let's see. Creation Expression of my Lifespan actually. I am going to change that from 300 to 40 so it will be easier to see. And I am going to edit that. Then I am going to go into Opacity Per Particle, Runtime Before Dynamics Expression and I am going to make 1 - smoothstep, change what that is there. I am going to make it the lifespan so I am going to go particleShape1.lifespanPP.

Then I am going to put age there. Going to get rid of the word frame. I want it to start at 0, the beginning of the particle's life, and I am going to edit this. So now I have something different. So essentially it's going to decrease over the particle's age. Going to go Edit. Now I will show you something fun. That is I have the word age there and let me open up that again. You will notice how it's filled in. In front of age, it's filled in for me, particleShape1. Cute. Okay, so let's run it. Let's go.

Now this is going to be a per particle attribute based on when the particle is born and when it dies. So some of the particles will be transparent and some of them won't. Well, they're so big that they are taking up the whole frame. Let's move back a bit and try that out here. See what we get this way. Hopefully we are going to see some difference. Okay, so you see that some of the particles are opaque and some of them are more transparent because this, since I have done it over a lifespan, it's calculating each particle's lifespan and during the particle's lifespan it's going from opaque, from 1 down to 0. So how much fun did we have with this smoothstep function? Hopefully a lot of fun and we will continue ever onwards.

Show transcript

#### This video is part of

Maya Particle Effects

26 video lessons · 7067 viewers

Author

Expand all | Collapse all
1. ### Introduction

1m 34s
1. Welcome
1m 2s
2. Working with the exercise files
32s
2. ### 1. Creating Images from Animated Particles

32m 11s
1. Mapping the image onto the plane
2m 3s
2. Creating a surface emitter with image colors
5m 20s
3. Setting particle attributes
3m 49s
4. Creating a vortex field
3m 47s
5. Creating and animating the first layer of particles
5m 33s
6. Creating and animating the second layer of particles
8m 25s
7. Emitting from a 3D object
3m 14s
3. ### 2. Creating Smoke

18m 35s
1. Creating smoke
7m 13s
2m 2s
3. Creating embers
5m 48s
4. Smoke demo
3m 32s
4. ### 3. Technical Supplements

22m 32s
1. Working with the forces
7m 27s
2. The dynamic Relationship Editor
4m 19s
3. Creating collisions and events
5m 46s
4. Creating attributes in the particle shape node
5m 0s
5. ### 4. Simple MEL Expressions

30m 18s
1. Using simple MEL expressions
7m 45s
2. Changing particle life spans with expressions
7m 15s
3. Changing particle radius with expressions
7m 45s
4. Line Step and Smooth Step
7m 33s
6. ### 5. Instancing Particles and Paint Effects

23m 42s
1. Instancing particles
7m 28s
2. Instancing paint effects onto particles
5m 6s
3. Randomizing paint effects
4m 23s
4. Instancing animation
1m 40s
5. A flock of butterflies
5m 5s

### Start learning today

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.

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

How to use exercise files.

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.

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.

Congratulations

You have completed Maya Particle Effects.

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.

Become a member to like this course.

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

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

How to use exercise files.

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.

• Mark video as unwatched
• Mark all as unwatched
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.

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.

#### Get our Annual Premium Membership at our best savings yet.

Thanks for signing up.

We’ll send you a confirmation email shortly.

• new course releases
• general communications
• special notices

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

• new course releases