Join Aaron F. Ross for an in-depth discussion in this video Creating 3D fluid containers, part of Creating Natural Environments in Maya.
In this chapter, we are going to create realistic clouds using Maya fluids, and fluids are one of the most amazing parts of Maya, and they are very, very deep. The feature set is so deep that we could easily spend five hours training and barely scratch the surface on what it can do. In this particular chapter, we are just going to use maybe 1% of the capabilities of Maya fluids, but even that will get us in a pretty good place. First thing I would like to share with you is how to load a fluid preset into Maya, because thankfully some commonly required effects are shipping with Maya.
So what you want to do, just so you can sort of browse these presets, is go to Window > General Editors > Visor. We saw the visor before when we were looking at 2D Paint Effects. Now I can browse through all the different folders in the Maya program directory that contain these preset files, and you'll see Fluid Examples. And there are lots of then. There's fire. It's very realistic. You do have to spend a lot of time to get it to look just right, but it's quite realistic and quite convincing for film-quality effects.
There is fire and smoke and all sorts of cool stuff. We're going for CloudsAndFog right now. So you'll see that there is a bunch of cloud presets. So, for example, we've got these billowy clouds. Let's take a look at one of these. I'll just go ahead and load that into Maya. The process is just to simply middle- mouse drag that into the viewport, and that will merge into the current scene. I'm getting an error here, but don't panic; Maya will show all sorts of errors all the time, and the reason that this is showing up is probably because this was created in an earlier version of Maya.
But don't panic when you see error messages in Maya because most of the time it's nothing to worry about. So I've got that loaded in. I will go ahead and close the visor, and I will just dial in closer so we can see what we are looking at here. You will notice that this preset has got a camera in it, and it may have lights in it as well. So the visor is useful for sort of seeing what you can do, but if you want to use these files, I need to do some cleanup and remove all that extra stuff in there that's not needed.
So this is a 3D fluid container we are looking at, And if I press the 5 key on my keyboard, we can see it shaded, and if I press the 6 key, we will see shaded and textured, and just as I predicted. In fact, there is a bunch of extra stuff in here. There is a camera and a light. I will just go ahead and delete that camera really quickly. So this is a 3D container, and it's currently populated with clouds. These are non-dynamic clouds, and that's the technique we will be exploring in this chapter.
Fluid effects have the ability to actually flow through this container. So in fact, you can get all sorts of interesting effects, like lava and fire and so on, that are truly dynamic. But this is not a dynamic fluid; in fact this is just a texture. I can do a quick render of that to see what that looks like. So we are seeing clouds against the background here, nothing too fancy. But we're just getting started here. So if you want to start from a visor preset, that's the process for doing it.
You just middle-mouse drag into the viewport, and then if you wish you can start making changes to the fluid container. So let's look at another way of doing this. I am going to go ahead and create a new scene. Just blow that away. And if you want to create a fluid container from scratch, what you will do is go into the Dynamics menu set and here you will see Fluid Effects as a menu and you can create a 3D container.
I am just going to create it with the default settings, and it will be created very small with a size of about 10. There are some more presets included with Maya. They are actually in the program directory and you can access those through the Attribute editor. So I've got my fluid container selected, and I'll hit Ctrl+A on the keyboard to open the Attribute editor. And currently the fluidShape node is selected, and we will be looking at some of these controls.
We won't have time to explore it in detail. Right now, all we want to do is load in a preset. So you will see in the Attribute editor there is a button that says Presets, and if it's got an asterisk next to it, that means that there are presets present for this particular node type. So presets are only valid for a single node at a time, and the fluidShape node, in a way it is both a model and a shader, so it's a sort of a self-contained node that doesn't necessarily need to connect anything else.
So that gives me the ability, actually, to click Presets here and choose one of these other options and just load that in. So you'll see here--here is one-- cloudBank, and if I want to just completely replace the current attributes for this node, I will just choose Replace. Boom! And now I've got a cloud bank in my view. And if I want to see that, once again I want to press the 5 key to see shading and the 6 key to see texturing. Now, there are no lights in my scene or anything; it's just merely only the fluid container. And the appearance of lighting here is controlled completely from within the fluid shading node.
So it's pretty small. If I wanted to actually use this in a landscape scene, I would want to scale that up. So the best way to do that is simply select it, go over to the Channel box, and scale that up by a factor of ten, a hundred, or a thousand, or whatever. So if I scale this up by a factor of 100 in all three axes, now I have got a larger cloud bank. We can play around with some of the attributes for this and try to push it into shape to make it look better. But ultimately I think it's more effective for us, in terms of learning, to actually start from scratch and build up a fluid cloud from nothing, because it takes just as long to take one of these presets and push it into something you like.
So that's what we will do next. We will start from scratch, and we will build up a fluid shader from zero.
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.