Join Aaron F. Ross for an in-depth discussion in this video Understanding 3D paint effects, part of Creating Natural Environments in Maya.
In this chapter, we are going to be looking at 3D Paint Effects, which are really one of the shining achievements of Maya, and will greatly streamline your workflow, because you can easily populate a scene with things like foliage and rocks and background geometry that would be too time consuming for you to model by hand. So what I've got here in this scene is a camera-centric layout in which the camera is just locked down, and I've painted Paint Effects onto this ground plane in just the areas that the camera can see.
So if we look in the Perspective view here, that'll be a little bit clearer. Press the 5 key, so I can see shading. So my camera is here, and I've got Paint Effects only in the regions that the camera can see. So, for example, in these valleys here, the camera can't see that, so I didn't bother painting. And also in the background here, in the distance, it would be overkill for me to put Paint Effects up there, so I've just used a texture instead. So if I press the 6 key, you can see that underlying texture that I painted earlier.
Go back to 5 key to look at shading. So Paint Effects is pretty amazing, and it gives you quite a lot of power and it's fairly intuitive, but just like fluid, it's going to take a while for you to get familiar with it. It's a monolithic node that has many, many attributes--probably hundreds of attributes for you to play around with, which means you can customize it endlessly and pretty much get almost any plant or background object that you would want to achieve. But again, it will take a substantial time investment to get there.
Okay, and also let's take a look at the rendered image. So if I go to File > View Image, in my Images folder in the current project, you can take a look at this green_hills image. So this is the actual rendered image from the scene that we just saw, and this particular still image took about 15 or 20 minutes to render the single image, so be prepared for some long waits on your rendered times when populating a scene with this much geometry.
However, that's even faster than it would be if you were using traditional modeling techniques. Paint Effects have a special pipeline into the Maya software renderer that kind of bypasses a lot of the usual calculations, and is much, much faster than if you'd modeled with traditional techniques. A couple other points around this. You'll notice that it looks a little bit cartoony, and that's because I've got some very simple lighting in this scene. You can actually use more advanced lighting techniques.
We will talk about that a little bit later. But for now, just keep in mind that using the Maya Software renderer and simple lighting, this is about the best that you can achieve with Paint Effects, and it looks a little bit cartoony, but it's good enough for our purposes in terms of training. Cool! So let's take a look at building Paint Effects. So I will just create a new scene, and in my Perspective view, I'll just turn on the grid so I can see it. And I am going to hide this Panel toolbar, so I can just get rid of some of the visual clutter. That's Ctrl+Shift+M. One way to create 3D Paint Effects is from the shelf.
So if you don't see the shelf, you can turn it on from Display > User Interface Elements > Shelf. You'll see that there is a PaintEffects tab, so I'll go ahead and select that. And I will need to get in much, much closer to the grid because the default Paint Effects are very small. So if you want to just draw a Paint Effects onto a blank scene, it's very simple; you just choose one of these presets and start drawing. So, for example, let's go down one notch here. One of the classic perennial ones is the Raw Meat brush.
We can't live without the Raw Meat brush. There it is, and it won't actually look like much in the viewport. Even if I hit the 5 or 6 keys, I won't see the texture. But if I do a quick test rendering of that, there you go. Pretty amazing, okay. How about something else? Let's delete that. Let's go back up a little bit in our shelf, and another good demonstration one is the Daisy. So I will click on that, and just draw out a few daisies in my scene, and notice how small they are.
They are all about one unit in size. Get in a little bit closer on those, we can kind of see some texturing on that. So I just want to take a moment and talk about the basic concepts around Paint Effects: first of all, the difference between a brush and a stroke and a tube. So the brush is the tool. So when I click on this button here, I am loading a brush into the Template brush. We saw this in an earlier chapter when we were talking about 2D Paint Effects.
The Template brush is sort of a staging area where you can load in some attributes into the next stroke that you are about to draw. So that's here, Paint Effects > Template Brush. Let me just open this up, so we can see this a little bit better, some of these attributes. If I choose a different brush, let's say I click here, it will load all of that into the Template brush, and go back to the Daisy. So the brush is the tool, and the stroke is the object--that's the actual line that I've drawn here--and the tubes are the geometry that sprout out from the stroke.
So you've got all three with 3D Paint Effects: you've got the brush, which is a tool; you've got the stroke, which is the line or curve; and you've got the tubes, which is the actual 3D geometry. So what else do we want to do here? We also want to play around with some of the more basic attributes of a stroke, such as how it's displayed. If you've got a really heavy scene, you cannot effectively display all of these at once like this, so you have to kind of simplify things.
So, you'll see, when you select the geometry with the Select tool or any other Transform tools, you can go into the Channel box and you'll see Draw As Mesh and Display Percent. So almost always you'll have to turn these down; otherwise, you'll have a super, super slow performance in the viewport. So Draw As Mesh is really important. If I just set that to 0 or off, then we will see just wireframes, and that's regardless of whether you're in Shaded mode in the viewport or not. You'll always see wireframes here.
So that's pretty important. Then you have also got this Display Percent. If I knock this down to 50%, you will see a much simpler approximation of our Paint Effects. But note that when I set it down to 50%, it looked like some of my daisies disappeared. But in fact, they did not disappear; they are still there, as you can see in this quick rendering. So this is just for the purposes of the viewport. Turn that back to 100%. Another thing that you'll want to do is to control the Paint Effects tool itself, so that, for example, you will always draw with Draw As Mesh turned off.
That's pretty important. So if I go into the Rendering menu set in Paint Effects, I can go into the Paint Effects Tool options and right up top here, you'll see Draw as mesh. If I disable that, then whenever I draw any Paint Effects in the view, they will be defaulted to Draw as mesh off. So with it off now, if I choose some other brush, like this clump of grass, and I draw in here, you notice that it immediately turned that Draw as mesh attribute off.
So when I draw the first stroke here, it draws this mesh for a moment, but then when I release the mouse, it turns into wireframe. So that's a lot more efficient. We could also play around with things here like the Display quality. If we wanted to do that, we can say oh, let's only display those at 10% quality from now on. Let me draw, and that'll knock that way down. Additionally, by the way, if you select more than one stroke in the view, you can change those attributes all at once in the Channel box. So, for example, if I select these strokes, grab my Select tool, and if I select these strokes, I can go in here and change their attributes all at once.
So, for example, I can turn Draw As Mesh back on again with a 1. I can change the Display Percent back to 100. Those are some basic concepts around Paint Effects. There's one more thing that we want to just play around with really quickly, which is there is another option dialog in the Paint Effects menu which is Paint Effects Globals. So I want to go in there and open up the Scene section, and this is an overall scale multiplier for your entire scene.
So, any Paint Effects that you draw will be multiplied by this scale, and it doesn't do anything to the existing Paint Effects; It only affects the next stroke that you draw. I like to set this to a value of 1. That way I know that this scale I have in the actual Brush settings will not be altered by this Paint Effects Global setting. And just to show you what I mean by that, if I select one of these single strokes, and I go to Ctrl+A, Attributes, you'll see I have got a stroke node here and that corresponds to what we see in the Channel box.
But I've also got a Brush node, and those are the actual settings for the look, as we saw in the earlier chapter on 2D Paint Effects. You'll see that there is a Global Scale attribute here, and this will control the overall size of that Paint Effect stroke that's connected to the current brush. That's just a basic overview of drawing Paint Effects in your scene. We are going to go into a lot more depth in the following movies.
Recommended prerequisite: Maya 2011 Essential Training
- Laying out the scene
- Sculpting terrain with Soft Selection and the Sculpt Geometry tool
- Creating 2D textures using Artisan and Paint Effects
- Applying 2D and 3D procedural textures
- Building backgrounds with skydomes and matte paintings
- Shaping clouds with Maya Fluids
- Creating non-physical daylight and casting shadows
- Rendering with Maya software
Skill Level Intermediate
Q: When I create a new document and attempt to use the Fly tool, it works as expected. When I try to use the Fly tool with any of the downloaded exercise files, I get the following error message:
// Error: setAttr: A child attribute of 'camera1.rotate' is locked or connected and cannot be modified.
A: In some of the lessons, the camera is locked. That's by design.
If you want to unlock the camera, go to the Camera panel menu directly above the viewport. Choose View > Select Camera. Now look in the Channel Box. The Translate or Rotate channels may be grayed out. Click-drag the names (not the numbers) to select multiple channels. Then right-click and choose Unlock Selected.
One exception: if you see a channel displaying in blue, that means the camera is constrained to something. For example, the Rotate channels could be aim-constrained to the camera's aim point. You don't need to unlock these and you shouldn't try to change them or keyframe them.