navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Understanding Maya nCloth

Understanding Maya nCloth

with Aaron F. Ross

 


Take an in-depth look at nCloth, the Maya toolkit for simulating high-resolution mesh cloth for 3D characters and animations. Author Aaron F. Ross explains the roles played by the various "actors" in an nCloth simulation, including the nucleus solver, nCloth objects, passive colliders, and nConstraints. The course begins with basic simulations such as flags and ropes, then progresses to building a simple garment, until finally integrating animation and special effects like falling leaves and tearing cloth. Aaron also covers performance optimization techniques such as nCloth and nucleus solver settings, proxy objects, collision layers, the Wrap deformer, and more.
Topics include:
  • Understanding the nucleus solver
  • Adopting a scale convention
  • Adjusting nCloth and nRigid attributes
  • Creating and animating nConstraints
  • Editing nConstraint membership and influence
  • Smoothing nCloth with subdivision surfaces
  • Storing and manipulating simulation data with nCache
  • Improving simulation quality and efficiency
  • Dressing an animated character
  • Painting dynamic attributes such as Stickiness
  • Simulating many objects such as falling leaves

show more

author
Aaron F. Ross
subject
3D + Animation, Visual Effects
software
Maya 2013
level
Intermediate
duration
3h 26m
released
Nov 30, 2012

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Welcome to Understanding Maya nCloth.
00:07My name is Aaron F. Ross.
00:09nCloth is Maya's cloth module for the nucleus simulation framework.
00:14In this course, we'll cover the following topics:
00:17employing best practices for modeling cloth, achieving physically accurate
00:22simulations, optimizing performance, applying constraints to connect cloth to
00:27other objects, storing simulations to disk with nCache, dressing an animated
00:33character, generating special effects, such as falling leaves, and more.
00:40It's my pleasure to share my experience with you now.
Collapse this transcript
What you should know before watching this course
00:00Before we begin our journey into Maya nCloth, I need to mention a couple of
00:05prerequisites, so that you won't get stuck.
00:09This is an intermediate level course, and we'll be covering a lot of ground, and
00:13I'll be assuming that you already know the basics of Maya; how to navigate the
00:17interface, and so on.
00:19You'll also need a fast computer.
00:21Dynamic simulations are notoriously calculation-intensive, and a multi-core or
00:27multi-processor computer is a very good idea.
00:30So if you've got many cores, if you have got a quad-core or higher machine, then
00:35Maya nCloth can take advantage of that.
00:38Finally, you need to have some patience and perseverance.
00:42Sometimes the simulations can take quite a long time to calculate, and you'll
00:46need to have ample time to wait around for that to happen.
00:50Additionally, because of the complexity, you'll need to adjust many
00:55different variables.
00:56nCloth has a lot of attributes to play with, and any one of those could have a
01:01really large effect on the simulation.
01:04Just keep trying, and eventually you'll get the result that you want.
Collapse this transcript
Using the exercise files
00:00We're about to jump in and get our feet wet with Maya nCloth, but first I need
00:04to mention a couple of things.
00:06You might notice throughout the course that my Maya looks a little bit
00:09different than yours.
00:10If you got a latest version of Maya, which is 2013, you'll be seeing white text
00:16on a black background.
00:17I prefer the opposite, black text on a light colored background, because I
00:21think that that's easier to read.
00:23I'm not going to cover how to set that up in this course, however, I did cover
00:27it in an earlier course, and that's Maya 2011:
00:31Creating Natural Environments, and there is a movie there called Setting Up the
00:35Project, and if you're on the Mac, there is actually another one that says
00:39Setting Up on the Mac, and it describes how to change the interface to this
00:43light colored interface, if that's your pleasure.
00:45Now, also, if you are a premium subscriber to lynda.com, then you have access to
00:49the exercise files, and that includes all the materials for the course.
00:54If you've downloaded those, then you will need to set Maya to that project. You
00:58will do that through the File menu; you will choose Set Project.
01:03I've placed those Exercise_Files right on my Desktop, so here they are now,
01:07and I'll just highlight that folder, and click Set, and then when I go to
01:12File > Open, it'll take me to the Exercise_Files/scenes folder, and here are all
01:18the scene files for the course.
01:21If you're not a premium subscriber, then you'll need to create a project, and
01:25save your work as you go.
Collapse this transcript
1. nCloth Basics
Understanding the Nucleus solver
00:00Before we begin building an nCloth scene, I want to spend a few minutes
00:05describing the nature of Nucleus.
00:08Nucleus is the underlying framework upon which nCloth is built, and other modules
00:14within Maya have been built upon Nucleus as well.
00:18Currently, with version 2013, we've got nParticles, and also nHair.
00:24Today, we're going to be focusing, of course, on nCloth, but let's talk for a
00:28moment about the basic components of a Nucleus simulation.
00:34So I've got a constraint here, which is attach the flag to the pole, or to near
00:40the pole anyway, and I am going to click here just to select that constraint, and
00:45open up the Attribute Editor -- Control+A -- because here we can see all these tabs, and
00:49that will help to explain the process for a Nucleus simulation.
00:55I've got this constraint node selected, but there are also other nodes here.
01:00There is an nClothShape node, and that has all of the physical properties of our
01:07cloth: how stretchy is it, how heavy is it, how thick is it, and so on.
01:13And then we've also got over here another node, which is the nucleus node, and
01:17that, if I scroll up to the top you will see, has got some really basic
01:21parameters here under Gravity and Wind, and that's a dead giveaway that this is
01:26the global settings for the entire Nucleus system.
01:31I could have 10 flags all attached to the same nucleus solver node, and they
01:37would all have the same Wind Speed in the same Direction, same Gravity, and so on.
01:43The nucleus solver also have some important properties down in here in
01:46Solver Attributes that let you control the quality of your simulation on a global scale.
01:51We'll be looking at all these in detail later.
01:54I wanted to just give an overview of the basic concepts of Nucleus, and how
01:59that relates to nCloth.
Collapse this transcript
Setting animation preferences
00:00Before we start building nCloth scenes, we need to just change a couple of quick preferences.
00:05Most importantly is the playback rate of the timeline.
00:09It's really critical that we don't skip frames in the timeline.
00:14It's possible that if you have your timeline settings set to real-time, then,
00:19when you try to play back a dynamic simulation, it will break.
00:23Real-time is not what you want. You need it to play every frame, and not to skip any frames.
00:28If it skips frames, then your simulation is going to break, and the reason for
00:33that is that Maya's dynamics are so-called history dependent.
00:37What happens on a particular frame -- lets say frame 10 -- depends directly upon what
00:42happened on the frame before it; frame 9.
00:45If the playback engine skips frame 9, then the data on frame 10 is going to be
00:50bogus, and your simulations is going break.
00:54We just have to make sure that we don't play back in so called real-time.
00:58We can do that in a couple of ways.
01:00One way is to go into the Preferences.
01:02Window > Settings Preferences > Preferences, and in Time Slider, we have got the
01:08Playback options here. You'll see the Playback speed is at currently Play
01:13every frame, and that's good; we need that.
01:16If we were set to real-time, then again, we would have problems. That needs to be
01:21set to Play every frame. Below that you will see Max Playback Speed, and I've
01:26currently got that set to Real-time.
01:29What that means is, in a lightweight scene the playback engine will not exceed
01:34the current time base, which is 24 frames per second.
01:38But in fact, the default is free, which means that in a lightweight scene --
01:43one that's not very computationally expensive -- the playback rate will be too fast,
01:48and you may not notice.
01:49It's just important that the playback speed never exceed 24, or whatever
01:54your current time base is.
01:56Otherwise, what you see in the viewport will not correspond to what you get when
02:00you render it. That wants to be set to Real-time.
02:05I've also chosen to choose Update view All, meaning that we will see playback in
02:10all the viewports, regardless of which one is selected.
02:14You could also change that setting of the Playback rate from the timeline itself
02:19by right-clicking, and choose Playback speed > Play Every Frame > Max Real-time.
02:26This is the setting that you need 100% of the time when using dynamics, and any
02:32other setting is either going to cause your dynamic system to break, or for it to
02:36play too fast, giving you a bogus idea of the animation timing.
02:43And also, just to make sure that we know what our current playback rate is, we
02:48want to enable the frame rate in the viewports, and that's done in the Display
02:53menu, under Heads Up Display, and I'll to enable Frame Rate, and now it appears
02:59down here in the lower right-hand corner of the viewport, and if I press play,
03:03you'll see that it's giving me a readout of approximately 24 frames a second.
03:08Those are critical settings that you need to have enabled for all dynamics, and
03:14nCloth is certainly dynamics,
03:17so we need to have those turned on.
Collapse this transcript
Adopting a scale convention
00:00The number one most important consideration when working with dynamics is scale.
00:06If your objects are not at the correct scale for the dynamic simulation, then you
00:12cannot reasonably expect your simulation to work properly.
00:16And unfortunately, it's not really an easy or straightforward process in Maya.
00:21I am going to lead you through that process, and try to explain it the best I can.
00:26What I have got here are three table cloths made from nCloth, and each one is at
00:32a different order of magnitude.
00:34This one is that a 1 to 1 scale, this is at a 1 to 10 scale, or 1/10 size,
00:42and this one is a 1/100 scale, or 1 to 100, so you see that that one is really teeny tiny.
00:49You have to adopt a scale convention before you begin to try to build a dynamic
00:54simulation. That means you've got to build your whole world to some known scale.
01:00In the world of Maya, objects have an absolute size.
01:04Now, the issue is slightly confused by the choice of units to measure the
01:09absolute size of objects.
01:12So let's take a look at our Preferences under Window > Settings preferences >
01:17Preferences, and within here, we've got the Settings section. And you'll see
01:23Working Units here, and it's says Linear Working Units are set to Centimeter.
01:27What that means is that a Maya "Maya unit" is being represented as a Centimeter.
01:35Another way of saying that is that one grid line is currently being drawn
01:401 centimeter long.
01:42If I change this to meter, then the spacing between gridlines is now 1 meter,
01:48but that doesn't change the absolute size of objects in the scene; they remain constant.
01:54This setting is merely a choice of how you wish to measure Maya's
01:58little miniature world.
01:59So you can change this all day long, and in fact, it will not affect your
02:05dynamic simulation at all.
02:07So this is where the documentation kind of leads people astray, because it
02:12tells people to model their scene to meters,
02:15and if you just set this Linear Working Unit to meter, and then build your
02:21scene, you may or may not actually get a physically accurate result. There's
02:25other variables here.
02:27What I recommend is that you choose whatever unit of measurement is convenient
02:32to you -- and the default of centimeter is actually probably the safest -- and then
02:38build your scene according to those units.
02:40In other words, my tablecloth was about 100 units from end to end, or 1 meter square.
02:48So I am going to leave that as centimeters.
02:51As we will see, once we have established a scale convention, then we can tell
02:56Nucleus what scale convention we've adopted, and then the simulation will
03:02actually run properly.
03:04One last point of information is that Maya's dynamics engine, whether it's nCloth,
03:09or Rigid Bodies, or whatever, they all assume that you've built your world at
03:141/100 scale; not at 1 to 1 scale.
03:18So if my object were at 1 to 100 scale, then I'd build it to be 1 centimeter from side to
03:27side, but then kind of imagine in my head that it's in meter, because you can't
03:32actually build a gigantor scene at 1 to 1 scale,
03:36meaning that if you have a very large scene that's, let's say, the size of a
03:39city, it's not possible for you to build that at 1 to 1 scale; you actually
03:44have to make a miniature.
03:46So that's why these are the three main conventions that you will see in Maya
03:49scenes: 1 to 1 scale, 1 to 100 scale, which is what dynamics want you to build at,
03:56and 1 to 10 scale, which is kind of a compromise.
03:59It's just important that before you begin building things, you decide what scale
04:04convention you're going to adopt, and then carry that through in the construction
04:08of all your assets. Then when you get to creating dynamics, you can adjust the
04:14dynamics engine to correspond to whatever scale convention you have chosen.
04:19I actually build all of my scenes at 1 to 1 scale, and that's the scale
04:23convention that will be adopting in this course.
Collapse this transcript
Building polygon primitives
00:00Let's build a kind of a hello
00:02world scene, where we just make a tablecloth, and just drop it onto a round
00:07circular table, and that will get us through the basic processes of nCloth.
00:12We want to decide on a scale convention to begin with, and as I said, I like to
00:16build my scenes at a 1 to 1 scale, because that's what most other programs use.
00:20So I just want to verify in my Settings Preferences, Preferences that my settings
00:26are currently Working Units set to centimeter, and that means that a grid line is
00:31currently 1 centimeter.
00:33I want to resize the grid itself, because this is only currently 12 centimeters
00:40from center to edge.
00:41I'll go up to the Display menu, and choose the Grid options, and the first one
00:46here, Length and Width, is the extent of the grid in the perspective view.
00:50I'll set that to 200 centimeters. Hit Apply, and you'll see that extends now out
00:55to 200 units from the origin, but the spacing of the grid is too tight for me to
01:02be able to see what I'm doing.
01:04I am going to change the number of grid lines to be 1 grid line every 100
01:09units, and hit Apply.
01:11Now I have got a grid line every 100 units, but it's a little bit confusing,
01:16because we are also seeing subdivision lines here.
01:20Confusingly, the Maya subdivision and main grid lines are the same color by default,
01:27so it makes it really hard for you to know what you're doing.
01:30What I recommend is you set the grid lines and the subdivision lines to be
01:34two different colors.
01:36I'll just change that grid lines color to slightly darker gray, and hit Apply, and
01:41now you can see what's going on here; this is a major grid line, and these are
01:45minor gridlines, or subdivision lines.
01:48Now, what we see here currently now is a major grid line every 100 units, and
01:53a subdivision line every 100 divided by 5, which is every 20 units, or every 20 centimeters.
02:00I'm just going to set the number of subdivisions to 10, and hit Apply.
02:06Now what I've got is a major grid line every 100 units, and a minor gridline
02:11every 100 divided by 10, or every 10 units.
02:15If you're not quite sure what you're seeing here, you know, you can go scrolling
02:18down into this Display section, and turn on numbers on the axes, and hit Apply, and
02:24that will be a little bit easier for you to get a grasp on how big things are by
02:29just looking at the grid.
02:30So I know that the distance from here to here is 1 meter, or 100 centimeters.
02:36Now I am ready to build my tabletop. nCloth only works with polygon objects; you
02:41can't use NURBS, and you can use subdivs, although you can smooth polygon objects
02:46after they have been built,
02:48but you'll always have to start from a polygon object.Drag out to create that
02:53cylinder, release the mouse, that sets the radius, and then I'll click and drag up
02:58to set the height, and I have got a primitive cylinder.
03:01I'll press the 5 key, so I can see shading.
03:04I'll just go into the Shape node here, into this input, and just increase the
03:08number divisions a little bit, just so it's a little bit smoother around the
03:11edges. I'll set that to, let's say, 30, just so it's a little bit smoother. That's my tabletop.
03:18Now I need a tablecloth to drop on it.
03:20Go back to the Create menu, Polygon Primitives > Plane, and with nCloth, you'll
03:27actually get the best results if you use two-dimensional geometry.
03:32In other words, planar geometry; something that has no thickness to it.
03:37Later in the course, we'll see how you can create cloth objects that have real
03:41thickness, involving using a wrap deformer.
03:45But the cloth objects themselves, the ones that are going to be dynamic, should
03:49really be two-dimensional, and flat, no thickness, so that plane is perfect for that.
03:54I just want to go into those Inputs once again, and I'll set the Width and Height
03:58to be 200, so that's a pretty big plane; that's 2 meters, or 6 feet on a side.
04:04Then I have got the number of subdivisions. This will not deform, because it's
04:09got no internal geometry. It has to have some grid structure to it in order for it to deform.
04:15I'm going to go ahead and select Subdivisions Width and Height, and set those
04:20both to a value of 20, and that should be fine.
04:23That's a pretty good level of detail for a cloth object.
04:27Another important point about nCloth is that you are going to get best results
04:32if your polygons are square. That's not an absolute rule, but if the polygons
04:37are long, and skinny, and rectangular, then that's going to negatively affect the simulation.
04:43If I had something like this, I would not get a very good result from that, or
04:48likewise, if I had too few divisions running in the other direction.
04:54My advice is, try to make them square if possible.
04:57Also, try to avoid triangles, or n-gons, which is a polygon with more than four sides.
05:04Just to keep on the safe side, I am going to delete the construction history on these.
05:08I have set the level of detail, and I want to protect myself from accidentally
05:13changing the level of detail later, which, if I am not careful about what I'm
05:18doing, I could actually break my simulation.
05:20So to prevent any negative outcomes from happening, I am going to delete the
05:24construction history on my entire scene. Edit > Delete All by Type > History, and
05:30now when I select either one of those primitives, you will see that there is no
05:34more input node, and there's no more parameters, like Radius.
05:37And again, that just to safeguard myself against breaking the simulation
05:41later on.
Collapse this transcript
Freezing transforms
00:00Before I create nCloth, I want to talk a little bit about freezing transforms.
00:05Ideally, your nCloth objects should have Scales of 1, 1, 1, and that's pretty
00:10much the case for all objects in Maya.
00:14If you've used the Scale tool, and changed the scale of your objects -- maybe I
00:20decided I didn't want it to be quite so large; maybe about 1 meter on a side,
00:24rather than 2 meters -- then I could scale these both down to a value of 0.5.
00:30If I do that, then the best practice is to freeze the transforms.
00:34As you probably know, freezing transforms will restore these values to 0.
00:40In other words, whatever the current values are, those become the new 0,
00:45and whatever the current Scale values are, those get reset to 1, or frozen to a value of 1.
00:51Here we go; Modify > Freeze Transformations.
00:55I can go into the Option box for that.
00:57You can see I can choose to freeze any one of the transforms.
01:00I am going to do all three, and click Freeze Transform.
01:04Now when I select either one of these, you will see that we've got Translate and
01:08Rotate values of 0, and Scale values of 1.
01:12This is really helpful, not just to prevent any possible issues with the
01:15dynamics, but also so that we can always get these objects back to the
01:19starting positions.
01:21If we've moved them around, or done strange things to them, we can always
01:24get them back to where they were by simply just setting all their Translate
01:29and Rotate values to 0. Simple enough!
01:32It's just a best practice to always freeze the transform before creating
01:36a dynamic simulation.
Collapse this transcript
Creating passive colliders
00:00Now our scene is set up, and ready to animate. I just want to be able to see it
00:05a little bit better.
00:06It's a good idea to see the wireframes.
00:08In my panel toolbar here, I'm going to enable Wireframe on shaded.
00:12I'm going to hide that toolbar now;
00:16the shortcut for that is Control+Shift+M. Just get that out of the way, because we
00:22don't need that now.
00:23So, I've got a tabletop, and I've got a tablecloth.
00:27And so that the tablecloth will collide with the tabletop, I'll need to make the
00:33tabletop a so-called passive collider.
00:36I'll select that, and I want to go into the nDynamics menu set in the
00:41upper left-hand corner.
00:43You'll see there's a menu that says nMesh.
00:46You can see, at the very top, we've got two different options to create.
00:51There is Create Passive Collider, and Create nCloth.
00:55I want to choose Create Passive Collider, and activate that.
00:59Now you'll see that with that object selected, I don't see anything special
01:05in the Channel box.
01:07But let's open up the Attribute Editor, Control+A, with that object selected.
01:11Now you will see a few things.
01:13You will see nucleus 1;
01:15that is the master simulation node that's controlling all the objects.
01:20Then we've got an nRigidShape;
01:23that's a node type called nRigid,
01:25also known as passive collider.
01:28Just like everything in Maya, it needs to have at least two names for the same thing.
01:32It's got the menu name, which is human friendly, and then it's got the node name,
01:38which is more for programming purposes, or coding purposes.
01:42In the next movie, we will create an nCloth for the tablecloth.
Collapse this transcript
Creating nCloth
00:00Okay, we're ready to create nCloth for this tablecloth.
00:03I've only got 24 frames in the timeline currently.
00:06I just want to expand that little bit.
00:08Here's the end of my animation range. I'll set that to 96 frames, which is four
00:13seconds, and I'll select that cloth object, and go back to the nDynamics menu set,
00:18to nMesh, and choose Create nCloth.
00:22I want to go to the Option box for that, just to show you that there is one kind
00:28of semi-important attribute here, which is the Solver.
00:32It's possible for you to have more than one nucleus solver in the same scene;
00:36we'll look at that later in the course.
00:38You would use that if you've got two completely different systems that don't
00:42need to interact, or maybe one of them has to have wind on it, and the other one
00:47doesn't. In this case, I've only got one nucleus solver in the scene, and so
00:51that's what showing up in this pulldown list; it just says Solver nucleus1.
00:56If I needed to, I could create a new solver in the process of creating this nCloth shape,
01:01but in this case, I don't want that, because I need it to collide with the tabletop.
01:06Go ahead and click Create Cloth, and you'll see it turn magenta on the wireframes,
01:11and that's just an indicator that it's connected to nucleus.
01:15You'll also see, by the way, that there is a nucleus node here at the origin.
01:20You can access the attributes really easily by just clicking on that.
01:24So let's see what this looks like when we play it back; I'll rewind it, right-click
01:28on the timeline just to verify that my Playback Speed is Play Every Frame, Max
01:33Real-time, and I want to make sure that I've got my Heads Up Display Frame Rate visible.
01:39Display > Heads Up, Frame Rate. We'll play that through, and you can see that it is
01:45falling, and it is doing something, but its moving ultra slow.
01:48Give it a few more seconds here;
01:50let's give it like 240 frames, which is 10 seconds worth.
01:54So in 10 seconds, it's just touching that tablecloth, and kind of drifting over
01:59it; it looks very strange.
02:02This is an artifact of an improper scale.
02:05I've built my scene at 1 to 1 scale, but Nucleus assumes that my scene is
02:10built at 1 to 100 scale,
02:12so what we want to do is we want to fix that, and we'll do that in the next movie.
Collapse this transcript
Setting Nucleus Space Scale
00:00We've got our nCloth simulation working, but as you see, it's not looking correct.
00:06It won't even really bend properly.
00:08And at first blush, you might think that this is because maybe the dynamic
00:12properties of the cloth are not set correctly, maybe it's got too much stiffness,
00:17or something like that.
00:18So you might be tempted to select that, and go into its attributes, Control+A, and
00:23start playing around with these Dynamic Properties, changing the amount of
00:27Rigidity, or the amount of Compression Resistance, or whatever.
00:31But if you were to do that, you'd actually be barking up the wrong tree, because
00:35that's actually not the problem here.
00:37The problem is that Nucleus expects me to build my scene at 1 to 100 scale, but
00:43I've built my scene at 1 to 1 scale, and so currently, nucleus thinks that this
00:49tablecloth is actually not 1 meter from side to side, but 100 meters from side to
00:57side, and that's why it's not behaving correctly.
00:59So, I'm going to rewind. I want to go to the nucleus node,
01:04and there is a super important attribute that's kind of buried way down here at the bottom;
01:08you need to dig around find that. Here it is: Scale Attributes.
01:12I want to open that up,
01:14and this is probably the most important attribute in all of nucleus: Space Scale.
01:21If Space Scale is 1, then Nucleus thinks that your world is that 1:100 scale.
01:27If you've built your scene to 1 to 1 scale, then you'll need to put a
01:31multiplier value in here.
01:33But there's a catch; most people would think that, oh, I've got a scene that's
01:38built that 1 to 1 scale. Nucleus thinks that it's at 1 to 100 scale, so I'll just turn
01:44this up to a 100, multiplying it by 100.
01:47But in fact, that's actually the exact opposite of what you need to do.
01:51Nucleus thinks that this object is not 100 meters wide, but actually 10,000 meter
01:57wide; a 100 times a 100.
01:59Okay, well that's totally wrong.
02:02The weird thing here is that the Space Scale needs to be set to not 100, but the
02:08inverse of 100, or 1/100, or 0.01.
02:11For a scene that's built at 1 to 1 scale, the Space Scale needs to be 1/100.
02:18There you go. So now it's playing back correctly.
02:23General rule of thumb: if your scene is built at 1 to 1 scale, set the Space Scale to be 0.01.
02:31If your scene is built at 1/10 scale, set the Space Scale to 0.1, or 1/10, and if
02:39you're seen is built at 1/100 scale, then the Space Scale will be 1.
Collapse this transcript
Choosing an nCloth preset
00:00Alright, we've set our simulation to be at the correct scale for the scene that
00:05we built, and the next thing we want to do is to choose an nCloth preset, so that
00:10we can determine the dynamic properties of that cloth.
00:13I want to select it, and go to Control+A, attributes, and I want to go to the shape
00:19node, and it's just listed as nClothShape1.
00:23For any node in Maya, you can have presets that will store node values.
00:28Remember that each one of these tabs is a node,
00:31and we can store all of the values for that node in a preset.
00:37We can create our own presets, and Maya also ships with presets.
00:42And the nClothShape node is one where we really need presets, because there are
00:46many attributes here, and any one of these could have a really big effect on the
00:52end result. They're pretty sensitive.
00:55Therefore, it's very important that we start from a preset.
00:59That way we'll know that it's more or less working, and then we can adjust
01:03individual attributes of that preset in order to fine-tune it.
01:07To access the presets, just go ahead and hold down the Presets button, and you'll
01:12see there's lots of them in here.
01:14Let's try the tshirt preset.
01:15I'm still holding down the mouse, and I want to go over here to Replace, and what
01:19that's going to do is it's going to replace all the current values with the
01:23values that are stored in that preset. Release the mouse, and a bunch of those
01:28attribute values have changed.
01:30And now if I play my simulation, we're getting a different result.
01:34Let's try another one. Go back up to the Presets, and let's
01:38try concrete > Replace.
01:42So we can actually get rigid effects from nCloth; interesting.
01:47Let's try rubberSheet > Replace, and now if I play my simulation, that one was a lot
01:54stretchier. There is a lot of deformation to that rubber preset.
01:59But what I need to do is really make it so that it won't slip across that surface.
02:05I think what I'm going to do here is a burlap.
02:08Play that back, and that pretty much did what I wanted, although, as you can see,
02:13it's slipping off the table. We're going to fix that up in the next movie.
Collapse this transcript
Adjusting nCloth and nRigid attributes
00:00We've got a basic simulation going. I've chosen the burlap preset for my
00:04tablecloth, but what I need to do is really make it so that it won't slip across
00:09that surface, and we can adjust some simple attributes to make that happen.
00:13I'll select the tabletop, and go to Control+A to get the Attribute Editor, and I
00:18want to go to that RigidShape node, and scroll down a little bit here, and you will see, aha!
00:23There it is: Friction. That's the main thing.
00:25What if I gave it a Friction of 0, and play that back?
00:30It's going to slip off of there;
00:31it's going to take a little bit of time to do it, because it's a pretty thick
00:35heavy piece of burlap,
00:36but with a Friction of 0, it's not going to stick.
00:39It had a default Friction of 0.1;
00:41I could turn that up all the way to a full Friction value of 1.
00:47So that does actually increase the amount of friction, but we have to increase
00:51the friction on both of the objects, because it's the interaction between the
00:55two of them that's causing this effect.
00:57I want to select the cloth object, and go to its shape node, and find its
01:03Friction attribute as well.
01:05So, it's under Collisions > Friction, so it's got a value of 2.
01:10I'm going turn it up all the way to a value of 4.
01:13And you can see that it's still kind of slipping around, but we've got one more
01:17little ace in the hole here, which is Stickiness. Turn that up, and that's
01:21going to cause that cloth to just really stick to any collider object.
01:27In fact, I could have probably used just the Stickiness alone, but I wanted to
01:30take the opportunity to illustrate how Friction works as well.
01:35I'm pretty happy with that.
01:37We could play around with some of the other attributes too. Maybe you want it to kind
01:41of flow a little bit better, instead of kind of being so stiff.
01:45In my nClothShape node, I can go into the Dynamic Properties, and start
01:48playing around with things,
01:50just being aware that these are very sensitive attributes, and a small change may
01:56have a very large effect. My advice to you as you're learning how those attributes
02:00work is that you adjust this one attribute at a time.
02:04Adjust one thing, play it back; see what it did.
02:08If it did what you want, great. Leave it.
02:10If it did something you didn't want, then set it back the way you found it.
02:14Don't just start randomly changing stuff, because that's not going to work. You
02:18need to be really methodical and scientific about the process. You're basically
02:22running experiment to see which attributes do what.
02:26In this case, you'll see I've got Stretch Resistance, Compression Resistance,
02:30Bend Resistance; those are all at a pretty high value.
02:34Scrolling down a little bit, you'll see also Mass. I'm going to turn the Mass
02:38down a bit; let's try 0.5.
02:41Rewind. It's still falling at the same rate, but it's flowing a little bit better.
02:47And I can also reduce some of these other values, like the Stretch Resistance,
02:51and Compression Resistance, which is kind of the opposite of stretching.
02:55That's giving a little bit of a softer result.
02:58We can bring the Bend Resistance down too; maybe value of 1. Play that back.
03:04So you could play around with these, and try to get a better result. I'll just
03:09reduce the Damping too.
03:10Damping is kind of an overall chill out factor that's causing the simulation to
03:16sort of slow down with each frame, and there you go; with less damping now, I'm
03:20getting a better result, I think.
03:22In the following chapters, we'll learn more about how to fine-tune this, how
03:26to work with things like construction history, and even how to dress characters.
Collapse this transcript
2. Simulating Dynamic nCloth
Planning and preparing
00:00Now that we've got an idea of how nCloth works, we're going to apply that to a
00:05real world situation, which is making a flag blow in the breeze.
00:10To do that, we need to have an image to apply onto the flag first.
00:14I've provided some images here in the Exercise Files > sourceimages.
00:20And if you don't have the exercise files, you can go and find some images
00:24to place onto a flag.
00:26The reason we need these in advance is because the shape of that image will
00:32determine the shape of the flag itself.
00:34In other words, the aspect ratio of the image determines the aspect ratio of the
00:39actual geometry we're going to be using.
00:42Aspect ratio, of course, is the proportion of the width divided by the height.
00:46Again, we need to have that information before we begin.
00:50Additionally, we'll need to set up the UVs on the flag, and it's a lot easier to
00:55do that if you've got an image already done, and ready to put onto that flag.
00:59There we go; we've got them here in the Exercise Files > sourceimages.
01:02If you don't have the exercise files, then you'll need to go and find something,
01:06and put it into your current project sourceimages.
Collapse this transcript
Laying out the scene
00:00We're ready to start laying out our scene to make an animation of a flag
00:05waving in the breeze.
00:07I've carried over the same scale conventions and the same grid settings from
00:11the previous exercise.
00:13Let's just review that really quickly.
00:14In Window > Settings/Preferences > Preferences, under Settings, my current Linear
00:20Working Units are centimeters.
00:23And I'm going to build my object at 1:1 scale, meaning that my flag, if it were
00:28to be one meter wide, that would be 100 units.
00:32And you can see my Grid settings are set up for that already.
00:35We can go check in on that by going to the Display menu > Grid Options, and you can
00:40see I've got a Length and width of 200 units, or 2 meters from center to edge in
00:46the perspective view.
00:47I've got a grid line every 100 units, or every 1 meter, and subdivision lines
00:52every 100 divided by 10, or every 10 centimeters, or 1/10 of a meter.
00:59By the way, I want to mention in passing that if you are expecting the Grid
01:03Options dialog to tell you what your current grid settings are, unfortunately,
01:08that is not the case.
01:10It's very common, actually, that you'll open a scene, and have grid settings that
01:14don't match what you see in this dialog, because the dialogue is actually a way
01:18for you to establish new grid settings.
01:22And the only reason that these happen to match right now is because I've got a
01:27fresh, brand new scene, and these values were carried over from the last time I
01:32was in this Grid Options dialog.
01:35But if I were to open a different scene, that had different grid options, I would
01:40still see these values.
01:42This is not a way for you to check what the current state of the grid is;
01:46it's only a way for you to determine what you want the grid to be when you click OK.
01:52Now let's build a flag. I want to do that in the front view port.
01:56So I'll tap the spacebar, hover my mouse over the front viewport, and tap the
02:00spacebar again. Use the wheel to dolly back.
02:04I want to have a flag that's about a meter tall, or 100 units tall, and I want it
02:09to be up in the air, somewhere in this area here, about 400 units off the ground,
02:14or 4 meters off the ground.
02:16Go to the Create menu, in Polygon Primitives, and we'll choose Plane, and I'll go
02:21ahead and draw that out approximately the right size.
02:24Once I've got it approximately that size, I want to go into its Inputs, and I want
02:29to change up the Width and Height.
02:31Don't scale the object;
02:32use the attributes here to change the proportions.
02:36I've got an aspect ratio of 1.5 for my images. That would correspond to a Width
02:41of 150, and a Height of 100.
02:45If you're using some other images other than the ones that I provided, you'll
02:49need to figure out what the aspect ratio of that image is.
02:53Some flags are a 1.6 aspect ratio; some are actually even a 2:1 aspect ratio, where
02:59it's twice as wide as it is tall.
03:01You'll need to find the pixel dimensions of your image, divide the width by the height,
03:07that will give you the aspect ratio, and then you can use that to calculate what
03:11the width and height of the actual polygon object should be.
03:15If I wanted an aspect of 1.6, if the height were a 100, then the width would be a
03:20100 times 1.6, or 160.
03:24But I want a 150 in this case; that will match the images I already have.
03:30Now we need to set up our subdivisions; how many divisions do we want here?
03:35And we want to kind of err on the side of caution.
03:38If we add too much detail at this point, then our simulation's going to run
03:41really slow, and we'll have some issues trying to get it to work.
03:45We can smooth the nCloth afterwards at render time.
03:49In other words, use a kind of low level of detail to calculate the dynamics, and
03:54then smooth it over at render time, using a mesh smooth node, or some other way of
03:58dropping a subdivision algorithm on top of the dynamics.
04:03If I wanted the polygons to be, let's say, 5 centimeters on a side, then what I'd do
04:09is I would just divide these values.
04:12So 100 divided by 5 would be 20; that means I've got 20 divisions.
04:19So if it's a 100 top to bottom, divided by 20, that means each one of these
04:24segments is going be 5 centimeters, or 100 divided by 20.
04:29Likewise, with the width, if I want it to be equal, and square polygons, then this
04:35would be 150 divided by 5, which is 30.
04:39And now I've got square polygons, and I'm good to go.
04:43In the next movie, we'll look at applying a texture onto this, and getting it to
04:47fit properly on the surface.
Collapse this transcript
Defining materials
00:00Now I want to build a material, and place it onto the surface of the flag.
00:05Go ahead and select that flag, and I want to press the 5 key to see shading, and
00:10I also want to press the 6 key, so that once I have a texture applied, I will see
00:14it in the viewport.
00:15To assign a new material, I'm just going to right-click, and choose Assign New Material.
00:22My new material dialog pops up;
00:25I don't need any highlights on this, so I'll use a Lambert shader, or LambertmMaterial.
00:30The Attribute Editor opens automatically, and I've got Lambert2.
00:33Let me rename that, and I'll call this one flag1Lambert, and press Enter.
00:41I'll just increase the Diffuse amount a little bit; let's say, a value of 0.95.
00:45That will just make it render brighter.
00:48And I want to drop a map into this Color channel.
00:52I'll click here to create a new render node, and this going to be a file texture,
00:57so I'll choose File.
00:59Then in the Attribute Editor, I'll need to browse for that file, and it takes me
01:04directly to my current project sourceimages, and I'll select that first flag
01:08image, and click open. So there you go.
01:12I've got it placed onto the flag, but you might notice that it's not quite right.
01:16This red stripe here is much larger than the blue stripe here, and it doesn't
01:21match what I see over there.
01:23And that's because the UVs on the flag are not set up correctly by default.
01:28UVs, of course, are the texture placement coordinates, and what Maya does by
01:33default is assume that your object is a square.
01:37And in fact, if my flag actually was a perfect square, then it would fill the
01:42available area perfectly,
01:44but because my flag is not a square, it's not fitting correctly.
01:48That's easy enough to fix.
01:50I'll close the Attribute Editor. I want to select that flag, and I want to go
01:54into the polyPlane1 input node, and you'll see down here it says Create UVs.
02:01And I want the option here to turn Normalization Off.
02:05Normalization is, once again, stretching your texture to a perfect square, and
02:11that's not what I want here.
02:12This is a little bit non-standard terminology, because usually, in most programs,
02:17normalization means to stretch the UVs to fit the object, but in Maya world,
02:24normalization means to stretch the UVs to a square to fill the zero to one
02:29texture space. But in this case, I want to turn Normalization Off. And there we go;
02:35now my texture is fitting properly on the flag geometry.
Collapse this transcript
Constructing a simulation
00:00Before we convert our flag to nCloth, we should make a backup of it.
00:05Once you make something into an nCloth, you can actually remove the nCloth, but
00:11it's really difficult, and a painful process if you've done a whole bunch of work
00:16on it, and you will lose all that work,
00:18and essentially end up having to delete the object, and start over again. It's a real drag.
00:22We need to future-proof our work, and prevent that problem from occurring in the
00:26first place by simply duplicating the object before we convert it to nCloth.
00:32I want to select that plane, and I want to go to the Edit menu, and go to
00:37Duplicate Special options, and I'll reset the settings, so you can see what the
00:44default settings are, but the setting that we really want is we want to turn
00:48Duplicate input graph on.
00:51What that's going to do, it's going to make a new object that has all of the same
00:56nodes and attributes as the existing object.
01:01In other words, it'll make a new polyPlane input node, which will be
01:05independent of this one.
01:07If you chose Duplicate input connections, what you'd have is two shapes that were
01:13both connected to the same input node, and that's not what we want in this case.
01:18I've turned Duplicate input graph on, click Duplicate Special, and now I've got
01:23pPlane2, and polyPlane2, which is another input shape.
01:30So I can change that. We've got a totally different object that has the
01:34same initial properties.
01:37So we just need to organize this. I will go into my Outliner, and you see I've got
01:42pPlane1 and pPlane2.
01:43One of these is going to be a backup.
01:45I'll just use pPlane2. I'll double-click on that, and I'll call it flag_backup,
01:50and pPlane1, I'll simply call flag.
01:56I just want to hide this;
01:57I'll select it, go over to the Display, Layers here, and click on Create new layer
02:03containing the selected objects,
02:06and then I'll double-click on that.
02:07I just want to call this backupLayer.
02:11I could have actually saved it out to a completely different file, and
02:14re-imported it if I needed to, but this is much more straightforward.
02:18So we can see that that's actually happening. I'm just going to move that over to
02:22the side, and then turn it off by toggling the visibility of the layer.
02:27We've kind of set it up so that if we run into trouble, we can always go back to
02:32that other flag that happens to have the exact same properties as this one.
02:36Now, we should have a flagpole as well. In this version of the exercise, I'm
02:40not going to actually attach the flag to the flagpole directly, but I'm going
02:45to create a transform constraint, which will cause the flag to be locked in position.
02:50But I need a visual indicator of the flagpole, and I also want to make it so that
02:55it will have something to collide with.
02:58I'll tap the spacebar, and in the top view, I will just zoom out a little bit, and
03:03I want to create just a cylinder.
03:05Create > Polygon Primitives > Cylinder. At the origin, drag out the radius, and then
03:11in the perspective, or any other view, I'll click and drag to set the height, and
03:17then I'll need to just go into the Inputs here, polyCylinder1.
03:22And I'll set the Radius to 2 centimeters, and the Height to 500 centimeters.
03:29I just need to move that up, do that in front viewport; position that.
03:35And now, the number of divisions is always important.
03:39The Subdivisions Height should remain at 1, and Subdivisions Axis of 20 is probably fine.
03:46So I've got that flagpole; let me rename it. Double-click up here in the Channel
03:50box, and we'll call that flagpole. And I'm ready to create my simulation, so I'll
03:56go to my perspective view, press the 5 key, and then the 6 key, just position
04:03that flag a little bit closer to the pole, and I'll go ahead and create a passive
04:07collider on the pole.
04:10In the nDynamics menu set, I'll choose nMesh > Create Passive Collider, and for the
04:17flag, I'll select that, and go to nMesh > Create nCloth.
04:21I'll rewind to frame 1, and I'll set my timeline to, let's say, 120 frames for the
04:30end of the animation range.
04:33Press Play, and see what I get.
04:35And just as we saw with the tablecloth exercise, the flag is taking forever
04:40to fall through space.
04:42I built my scene at a 1:1 scale, and Maya expects my scene to be built at 1:100 scale,
04:50but it's easily fixed. I'll select either one of these objects, doesn't matter
04:54which; hit Control+A, so I can get to the nucleus node,
04:59and scrolling down, I'm looking for Scale Attributes.
05:04Open that up, and because this is a 1:1 scale world, the Space Scale attribute
05:11needs to be 0.01, and press Enter.
05:16Press Play, and see what I get. There we go; now it's falling through space.
05:21I could create a passive collider on the ground to catch the flag as it falls,
05:26but in fact, actually, nucleus has an implicit ground plane built into it.
05:31I can go up here where it says Ground Plane, and just turn that on, and that way the
05:36flag will actually have something to land on.
05:39That's the basics of our simulation, and in the next movie, we'll constrain the
05:43flag, so that it will stick to a certain location in space.
Collapse this transcript
Creating transform nConstraints
00:00Our flag is currently falling, and it's falling at the correct speed, because
00:06we've set the Space Scale.
00:08Now we want to attach it to the flagpole, or freeze certain parts of the flag to
00:15certain locations in space.
00:17To do this, we'll use a transform constraint; that's a flavor of nConstraint, and
00:22an nConstraint is a constraint that only applies to nucleus objects.
00:27It's a similar concept to standard animation constraints, such as, like, an orient
00:32constraint, or a parent constraint,
00:35but nConstraints, of course, only work with nucleus objects.
00:39What I want to do is select the flag, and then choose a vertex or vertices, and
00:44then apply the constraint.
00:46I'll right-click, and go to Vertex component mode, and I'll just select the
00:51top left corner of my flag, and I'll go to the nDynamics menu set, and
00:55choose nConstraint.
00:57You'll see there are a lot of menu items here.
01:00These are all just slightly different variations on the same node type.
01:04The nConstraint has lot of different options, and these menu items let you choose
01:09which options you want with a single click.
01:12In this case, we want a Transform nConstraint, which is essentially going to fix
01:17vertices to a certain location in space.
01:20Go ahead and click on that. Now I've got a new object in my scene, and I've got a
01:26new node in my Attribute Editor that says dynamicConstraint.
01:31And if I press Play, you'll see that it's trying to hold that flag in place.
01:36Couple of things about this; one, obviously the flag is way too stretchy.
01:41I can fix that by changing the preset.
01:44The other thing I'm seeing here is that the transform constraint doesn't
01:48have enough influence;
01:49it's only affecting that one vertex.
01:52We'll fix that in the next movie.
01:54Right now we can fix the stretchiness really easily by just selecting that flag.
01:59Go to the Attribute Editor, Control+A, and go to the shape node.
02:04You can click on Presets, and choose one of the other presets.
02:07I'm going to use the tshirt preset, and I'll Replace all of the attributes.
02:13Play that back, and it's not quite as stretchy anymore.
02:15That's pretty good. We'll fix the rest later.
02:18We'll give this a different range of influence in the next movie.
Collapse this transcript
Editing constraint membership
00:00Currently the transform constraint is only affecting one vertex, and that's not
00:05giving a very realistic effect.
00:08I can extend the influence of that transform constraint.
00:12What I need to do is to select the transform constraint node, and then select
00:16vertices on the flag, and then I can add those to the constraint.
00:20Let's getting really close here, I'll dolly in, and you can see there is
00:25a little cross there, and that's the locator for the transform constraint node itself.
00:31So I have got that selected, and then I also want to select vertices on the flag,
00:38so I'll hold down Shift, and click on the flag, and I'll right-click, and choose
00:43Vertex, and hold down Shift, and drag a rectangle to select some of these other vertices.
00:50Let's say, a grid that's 5 by 5; that should be plenty.
00:54I have now selected both the transform constraint, and the vertices, and I can go
01:01back up to nConstraint, and choose Add Members.
01:06And when I click off the object now you'll see that the transform constraint has
01:10got a lot more vertices, and if I select that transform constraint either here, or
01:16in the outliner, we'll see that indeed there are more vertices involved now.
01:23Let's play that, and see what it looks like.
01:26Alright, well we just added more vertices to that transform constraint.
01:30I also want to add another constraint node down here at the bottom.
01:35I can select the vertices in advance to make that happen.
01:38I'll select my flag, right-click to make sure I am in Vertex component mode, and
01:44drag out a rectangle to select 5 inches by 5 inches grid there, approximately.
01:50And with those vertices selected, I'll go up to nConstraint > Transform.
01:56Now, this time when I do it, the transform locator, that little cross, is
02:01positioned at the center of all of those vertices, and I actually want to move
02:07that over to the corner.
02:08I want to grab the Move tool, and select that little locator.
02:13And if you're having trouble selecting it, then use the outliner.
02:18Window > Outliner, dynamicConstraint2, and I want to move that down, and position it at the corner.
02:26Sometimes when you do this, and you play the simulation back, your object might jump around,
02:31but it will only do that once.
02:33If I rewind, and play, it didn't do it to be this time, but sometimes you'll
02:37see that your object will actually move, because you have moved the transform constraint.
02:43But don't panic, because if you just rewind, and play it back again, it will be fine.
02:48So we've added those vertices to those transform constraints; now we want to
02:52change the influence, so that it doesn't just have this huge selection of a block
02:58of vertices that don't move.
02:59And what we'll do is we'll play around with the dropoff, or production of
03:04influence based upon distance.
Collapse this transcript
Adjusting strength drop-off
00:00Our transform constraints are working, but as you see, all of these vertices are
00:06being basically glued in place.
00:09What we want is a transition where there will be a great deal of strength to
00:14the constraint here at the corner that falls off, or diminishes with distance.
00:21I want to select the transform constraint, and open up the Attribute Editor,
00:24Control+A, if it's not already open. And you're looking for a section that says
00:29Strength Dropoff, and directly above that is the Dropoff Distance,
00:35and these two work in conjunction; you have to actually adjust both of them to get a result.
00:40The Strength Dropoff is currently a flat line up here, meaning that there is no
00:46diminishment of strength over distance.
00:49What I need to do is click anywhere here in this little graph, and create a new
00:55point on that curve, and drag it down to the lower right-hand corner.
00:58And what this is doing is it's reducing the strength of the
01:04transform constraint.
01:06The left-hand side of the graph here corresponds to the position of the
01:10transform constraint icon, and the right-hand side of the graph is the strength
01:17at the Dropoff Distance.
01:19What I'm saying here now is that at 50 centimeters away, we will have Strength of 0.
01:27Press Play, and see what happens.
01:29We are seeing a little bit of diminishment of intensity or strength to that
01:34transform constraint, and we can tell here because these vertices here are
01:39showing these little dashed lines, which are springs connecting the constraint
01:43to the cloth vertices.
01:45What I need to do here is reduce the Dropoff Distance.
01:49Basically, I want to figure out what this distance here from that transform
01:53constraint to the farthest vertex.
01:55I'm going to estimate that to be about 15 centimeters. Rewind, and play back, and you see
02:04here that that fell completely off the pole. We can just give it a greater
02:10Dropoff Distance, and that will cause the overall strength to be greater.
02:13Of course, I could do other things, like change the dynamic properties of the cloth itself.
02:20That looks okay on that one, at least for a start.
02:22I'll go down here and select the other one.
02:25Once again, adjust the Strength Dropoff curve, so that it's falling off linearly
02:30from the position of the transform constraint to the Dropoff Distance here, and
02:36I'll set that to, let's try 15 on that one.
02:39It doesn't need to be as strong;
02:41the lower constraint can be weaker.
02:44So we just have to adjust these values a little bit until we get that flag to
02:48stay where it's intended to be.
02:50I'll increase the Dropoff Distance on the top one a bit;
02:53let's give that a value of 30.
02:56Press Play, and see what I get.
02:58And I could adjust the shape of this curve too, if that were my intent, you know,
03:03I could give that a different shape.
03:05But I think the linear transition is easier for me to comprehend, so I am going
03:10to leave it at that.
03:11Once I add wind in here, I might need to adjust those once again.
Collapse this transcript
Adding Nucleus wind
00:00We have got our transform constraints basically working.
00:03Let's add a little bit of wind to make our flag blow.
00:07I'll increase the end of my playback range to, let's say, 600 frames, and select
00:13any of those dynamic objects, and go to the Attribute Editor, Control+A, if it's not
00:19already open, and find the nucleus node.
00:22And near the top, you'll see a section that says Gravity and Wind, and we have
00:28got Wind Speed, and Wind Direction.
00:30The Wind Direction currently is set to 1 in X, so it's positive 1 in the X-axis, meaning
00:38that it's going to blow from left to right in my perspective view currently.
00:44Let's increase the Wind Speed.
00:46I'll give it a value of 100. Play back the simulation, and we're getting a little
00:52bit of wind. Let's increase the Wind Speed to 200; press Enter.
00:58There we go, that's better. And we could change the Direction as well.
01:04If we wanted it to blow in the opposite direction, then we would set Wind
01:08Direction X to be -1, and that would cause the wind to blow in the negative X
01:14direction, which would be right to left in this view.
01:18Now the wind is blowing the other way.
01:21I liked it better the other way, blowing in positive X, and I'll do that.
01:27Cool, we have got some wind.
Collapse this transcript
Using interactive playback
00:00Here's a really fun and very useful tool within Maya that will allow you
00:04to change attributes while the simulation is running; it's called
00:08interactive playback.
00:10To see this most dramatically, I am going to set the Wind Speed down to 0 to
00:15start with, and I'll go ahead and go up to the nDynamics menu set, to the nSolver
00:23menu, and you will see Interactive Playback.
00:27And when I activate that, it starts playing.
00:29You can see I have got no wind currently,
00:31but if I move this slider up, I am increasing the Wind Speed interactively in
00:36the viewport. So I crank that up to 200. And if I bring it back down to 0, the
00:43wind stops. Turn it back up, the wind starts again.
00:48And I can use this to fine-tune my scenes, and in fact, any attribute can be
00:53adjusted while you're running in interactive playback mode.
00:56You do have to prepare for that, though.
00:58If you wanted to adjust attributes, you need to get the Attribute Editor open to
01:02the page that you want to use.
01:04You also need to make sure you have enough time in your timeline.
01:08I've only got 600 frames.
01:09If I was going to be doing a lot of work, and testing a lot of things, I'd need to
01:14increase this to a much larger value, in the range of thousands,
01:17so I would have enough time in the timeline to play around with those attributes.
01:21That concludes our chapter on the basics of setting up an nCloth simulation.
01:27In the next chapter, we'll look at fine-tuning it, and directing it to produce
01:31a particular result.
Collapse this transcript
3. Directing nCloth
Tuning solver attributes
00:00Now that we've got a basic simulation running, we need to direct it, and
00:05fine-tune it, and make it better.
00:08What I want to show you in this movie is the solver attributes for the nucleus node.
00:13So I have got the nucleus node open already, I have selected my cloth, and hit
00:17Control+A to open the Attribute Editor.
00:19And in the nucleus tab, if we scroll down a bit, we'll find a section that
00:25says Solver Attributes.
00:27And essentially, there are really two main properties here that we can play
00:31with: the Substeps, and the Max Collision Iterations.
00:37Higher values will give you, quote, more accurate results.
00:42However, just increasing the value alone is not really going to be good enough
00:47to fix problems that you have, but it's a start at least.
00:52These default values are quite low, and if I increase them, what will happen is
00:58the simulation will start running more slowly, because it's working harder, and
01:03allegedly, more accurate.
01:05The Substeps refers to the number of calculations per frame, and with higher
01:12numbers, we will get a slower playback, and it'll actually, in a lot of cases,
01:18change the behavior of the cloth.
01:21And you can see here, this is kind of curious; I've increased the Substeps, and
01:25I've got a worse result.
01:26It was better before with lower Substeps.
01:30I'll take it back down to 4.
01:32That's kind of counterintuitive.
01:34We see things like this also with rigid body dynamics, where if you increase
01:39the Solver Attributes to improve the quality, it sometimes has a paradoxically reverse result.
01:47You can see here now that my cloth is kind of clumped up. We can try to help
01:51that along by increasing the number of Max Collision Iterations, and I'll set
01:56that to, let's say, 20.
01:58And what that does is it repeats the calculations more than once in order to
02:05find whether the cloth is intersecting or colliding with anything else.
02:12As I've increased the Max Collision Iterations to 20, that has actually
02:16corrected the problem of the cloth folding in, and getting stuck to itself.
02:21You will need to tune these Solver Attributes for each scene, and the default
02:26values are probably okay, but you will find that it's pretty common you'll need
02:31to increase the number of Max Collision Iterations.
Collapse this transcript
Checking the simulation with a Playblast
00:00As we increase the quality of the simulation, the playback will be slower and
00:04slower in the viewport,
00:06to the point where we may not be able to correctly evaluate whether the
00:10animation is moving at the right speed. Currently what I've done is I
00:15have increased the Max Collision Iterations up to 40 in order to
00:19illustrate the problem.
00:20You'll see that my frame rate here is hovering around 10 frames per second.
00:24It's hard for me to evaluate this, and to be able to tell whether or not this is
00:29running at the right speed.
00:31What I'll do is just simply make a Playblast. I'll rewind back to frame 1, and
00:36I'll go into the Window menu > Playblast, and let's go into the Options for that
00:41Playblast. This will just render a temporary movie out.
00:46I'm on Windows, so I want to use the avi format.
00:50You actually can use QuickTime; maybe we'll do that instead.
00:53I am going to choose a compressor, and since this is just a temporary movie, it
00:58doesn't really matter what compressor we use.
01:00I'll choose H.264, and just turn up the Quality.
01:04Scrolling down a little bit here, the render size for the Playblast is determined
01:08by this Display size option.
01:10If it's set to From window, with a Scale of 0.5, what we'll see is it will render
01:16out to be a quarter screen video. In other words, it will find the size of this
01:20window, and then reduce it down to half of that, which is quarter of the area.
01:27Down here, we have the ability to save the file if we need to, and I'm going
01:31to actually opt to do that. Turn on Save, and I want to give it a name; I'll call this 03_02.
01:40What I always do is I give the Playblast a name that exactly matches the name of
01:45the actual scene file.
01:47That way I know, if I've got lots of playblasts, I know which one is which.
01:52It's going to save into the movies directory in my current project.
01:57I'll go ahead and click Playblast, and allow it to play through.
02:01Now, I didn't set the range for the Playblast, meaning it'll just do the entire timeline.
02:09If I really need 600 frames, that's fine, but if I don't, I can actually
02:12just hit the Escape key, and that will kill the Playblast, and save what we have to disc.
02:20We've got QuickTime installed here, so that just goes and launches
02:23automatically, and now I can play this back, and try to determine if my movie
02:27looks correct. Is the cloth moving the way that I want it to, now that I'm
02:32seeing it at normal speed?
02:33Now, I do want to mention that since I've got my frame rate displayed here in the
02:39window, that frame rate is actually being captured, but that's the frame rate
02:44during the creation of the Playblast, not during playback of this movie.
02:51We could be pretty sure that this movie is actually playing back at the
02:54correct time base of 24.
02:56If you're not sure, you can actually go into the Movie Inspector in QuickTime,
03:02and check to see the Frame Rate, and it says it's a 24 frames per second movie.
03:07You will need to do this a lot, because it's really common that you will not be
03:11able to get real-time playback in the viewport, meaning that your fallback
03:14position is to make lots and lots of playblasts.
Collapse this transcript
Controlling collision thickness
00:00One of the most important properties of an nCloth shape is the
00:04collision thickness.
00:06That's an envelope around the cloth that determines whether or not the cloth is
00:12touching something, or colliding with something.
00:15The collision Thickness is found in the nClothShape node, in the top section here,
00:20which is Collisions.
00:22And currently, I've got a Thickness of 0.8 or so, and that seems to be
00:28working okay. I've got no wind in this particular scene, and I'm just checking to
00:32see if the cloth is self-intersecting.
00:35And as I look here, it seems okay; I don't see any areas where the cloth is
00:40actually poking through itself. Very good.
00:42I'll rewind, and let's reduce the Thickness down to 0.
00:46This is something you'd never do in production, or in real life.
00:49I'm doing that just to make my point, reducing the thickness down to nothing.
00:54Pressing Play, and immediately we see the difference here. The cloth is
01:00self-intersecting, and poking through itself.
01:03And that's a really terrible outcome, because if that cloth actually passes
01:07through itself, ironically, it can go inside itself, but once it gets in there,
01:12it gets trapped, and it can't get back out again.
01:14We can fix that simply by having a appropriate collision Thickness.
01:20You need to see the collision thickness envelope in order to really know what you're doing.
01:25What we can do is go down here where it's says Solver Display, and there's a
01:30pulldown list that currently says Off,
01:33and what we want to choose here is Collision Thickness.
01:36We have to have some non-zero thickness value to see it.
01:40And what you get is a mesh object, an envelope, that completely surrounds your
01:45nCloth, and as we increase the collision Thickness, we'll see that yellow
01:50envelope increase in thickness.
01:51Any collision object that is another nCloth, or an nRigid, or passive collider,
01:57any nucleus object that comes close to this cloth will collide with the cloth if
02:04it touches this outer envelope.
02:07And the Thickness of 1 centimeter here is fine; it's a little bit more than I had a
02:13moment ago, but it's doing what we want, essentially.
02:17When you're finished playing around with this, you want to turn that Solver
02:20Display back off again.
02:22I will mention that if you have a really large Thickness value, that the
02:26Simulation will run much more slowly. If I increase the Thickness to something
02:31like 5, and rewind, you might think that that would help the simulation, but in
02:35fact, it's become problematic.
02:38The collision thickness is too great, and we're not getting an efficient
02:42nCloth simulation now.
02:45So sometimes there is too much of a good thing.
02:48In my case here, the optimum value was a value of 1 centimeter.
Collapse this transcript
Adjusting dynamic properties
00:00To fine-tune the behavior of an nCloth Simulation, we'll want to play around with
00:05the Dynamic Properties.
00:07To do that, we want to have a better understanding of what those Dynamic
00:10Properties are doing.
00:11I want to select that nCloth object, and open up the Attribute Editor, and go to
00:16shape node, the nClothShape node.
00:18And I want to show you how nCloth kind of works.
00:22It's a spring system, and what it does is between any two adjacent vertices,
00:28there's something called a cross link, and it acts like a little spring.
00:32And that spring can change length.
00:35We can visualize those cross links by going into the Collision section, and to
00:40Solver Display, enabling Stretch Links here.
00:45And now you'll see those cross links that are connecting each pair of vertices.
00:50The Stretch Links, or cross links, are enabled by default.
00:54It is possible to turn them off, but that will kind of break your simulation.
00:58I want to scroll down to just show you in the Quality Settings area of
01:03the nClothShape node,
01:05there's a switch here that says Add Cross Links,
01:07and there's a bunch of options here about how those are supposed to behave.
01:11If I turn this off, and rewind my timeline, you'll see that all those
01:17cross links have disappeared.
01:19And if I try to play this, you'll see that it doesn't give a good result.
01:24It doesn't feel like cloth.
01:25It feels like some sort of unnatural material.
01:28And it's because the cloth is allowed to basically stretch without having
01:33any resistance to it.
01:34So I want to rewind, and I definitely do need those cross links enabled, and
01:40rewind again, so we can see them there.
01:43Now that I know that they are really back on, I'm going to turn those Stretch
01:46Links back off in the Solver Display section at the top, in the Collisions area of
01:50the Attribute Editor.
01:51So now that we kind of understand how it works under the hood, then these Dynamic
01:57Properties attributes will make a little bit more sense.
02:00Stretch Resistance and Compression Resistance are really the most important ones
02:04here, and that's why they're way up here at the top.
02:07Stretch Resistance is the length of the spring, and if it's a high Stretch
02:13Resistance, then the spring is not allowed to get much longer.
02:16So those cross links are not allowed to expand, or become longer than
02:20their initial value.
02:23And of course, if I increase the Stretch Resistance, then I'll get less stretchiness.
02:29Let's turn the shading back on here, press the 5 key, and then the 6 key.
02:34And so, if I have a greater Stretch Resistance -- you can go up to 200, or even
02:39higher -- then the cloth will not be able to stretch as much; it'll be stiffer.
02:44But if I have a really low Stretch Resistance, or turn it almost all the way
02:48off, then the cloth will be a lot stretchier, and that's a really extreme value, of course.
02:56You will find that as you increase the Stretch Resistance, then the simulation
03:00will run more slowly.
03:02It's working harder, trying to maintain the length of those cross links, so that
03:07they don't stretch too much.
03:09What I find is that I do have to increase that Stretch Resistance to quite a
03:13high value of a 100, or even more, in almost all cases, really.
03:18The complement to Stretch Resistance is Compression Resistance, which is
03:22resistance to the links becoming shorter.
03:25If I have a high Compression Resistance, then, of course, those links will not be
03:30allowed to become shorter.
03:32Generally, I would set them both to be approximately the same value.
03:36Below that, you will see Bend Resistance, and that has to do with the ability of
03:41the vertices to swivel and rotate around each other.
03:46And with a low Bend Resistance, then what will happen is the cloth will be
03:50allowed to fold and crumple, but with a high Bend Resistance, then it'll be a lot
03:55stiffer, and it'll take a lot more force to get it bending.
03:59I'll play that back.
04:00And with a Bend Resistance of 200, what we have is a very thick cloth;
04:06it's not really going to deform very much.
04:09But if I reduce that Bend Resistance, then it's going to bend quite a lot.
04:15And again, you'll see that that has an impact on performance.
04:19There are some other attributes in here that we're going to cover later in the course;
04:23things like Rigidity, and, Mass, and so on.
04:25I'm going to go ahead and move on to the next step.
Collapse this transcript
Smoothing nCloth with subdivision surfaces
00:00I've adjusted some of the Dynamic Properties a little bit,
00:03and I'm getting what I think is a pretty good result as I play that back.
00:08And you'll see that I'm getting nearly real-time playback; it's hovering around
00:1322 frames per second, and that's not too bad.
00:16But the reason why it's so good is because I've got a low level of detail to the cloth.
00:22I've got a grand total of only 600 quadrilaterals, or 1200 triangles on the entire model,
00:27and that's pretty low level of detail.
00:29Remember, you can always check your polygon count by going to the Display > Heads Up
00:34Display > Poly Count, and the selected object here is showing 1200 triangles, or 600
00:40faces. Turn that back off again.
00:44That's why it's playing back at near real-time speed;
00:47it's because it's a low level of detail.
00:49And that's what we want, in fact, for a cloth object; we really want to have the
00:53lowest possible level of detail that will work, so that our performance in the
00:58viewport will be reasonable.
01:00Especially when you start piling stuff on, it gets pretty difficult to work with
01:05if your frame rate is 1 frame per second.
01:07Of course, if you render this, it's not going to look that great, because these
01:12are straight line edges here.
01:13These are just ordinary polygon edges currently.
01:17But our ace in the whole is to simply smooth the cloth at render time,
01:22and there's a couple of different ways of doing that.
01:25The most obvious way, and the way that is probably the easiest is to simply
01:30select the cloth, and press the 3 key on the keyboard, and that enables
01:34smooth mesh preview.
01:36The 1 key turns it off, and the 3 key turns it on, and you can see that that's
01:42made a difference already.
01:44It's smoothed out my cloth.
01:46There is it without the smoothing, and then hit the 3 three key, and there it
01:50is with the smoothing.
01:51Actually, if I was rendering in mental ray, then in fact, that's all I would really need to do.
01:56It would render just like this.
01:58However, if I render with one of the other renderers, like Maya software,
02:02then unfortunately that smooth mesh preview is not going to be shown in the rendering.
02:08To illustrate, I'll get in really close here.
02:10And I'll do a quickie render in Maya software, and if you look closely, you
02:15can see that there are some jagged edges, especially down here; that's pretty clear.
02:21I if get in really close on that, and do another render, so we can see with no
02:25ambiguity, the smoothing is not being shown in the Maya software render.
02:30If we need to render in Maya software, or Maya hardware, or any of those
02:35other renderers, then the smooth mesh preview option is not really going to be available.
02:38What can we do instead?
02:40Well, I'm going to turn smooth mesh preview off by pressing the 1 key,
02:45and I'm going to do an old school technique here, which is the old mesh smooth node,
02:52and that's going to be found in the Polygons menu set.
02:55Go to Polygons, and I'll choose Mesh, and Smooth,
03:00and this is going to drop a node on top of the cloth.
03:04And what it's done now is it's just smoothed the cloth at one iteration.
03:09And this is actually changing the geometry;
03:11it's not just a render preview.
03:15Check the performance on that; not too bad.
03:18With that mesh smooth enabled, I'm still getting a frame rate of about 20 frames
03:23per second, so that's pretty impressive.
03:26We can play around with the mesh smooth options. We can select the cloth,
03:31and go into the Channel box, and you'll see in the Inputs polySmoothFace.
03:36Remember, in Maya everything has to have at least two names.
03:38There's the menu name, called mesh smooth, and the node name, which in this case is polySmoothFace.
03:43I want to click that to open it up to show you that we can increase the number
03:48of divisions if we need a smoother mesh.
03:51Play that back, and see our performance. Not bad.
03:54That looks really smooth, and I'm still getting a pretty good playback rate of
03:58about 15 frames per second.
04:00I'll knock that back down to Divisions of 1.
04:04If you look really closely, you might see that there's a couple little
04:08glitchy areas here,
04:09and what we can do here is we can play around with some of the options.
04:13We've got Keep Border; you can turn that off, and that's going to smooth the
04:19entire cloth, even at the edges.
04:22Keep Border is a tricky attribute. It's enabled by default, and what it's intended
04:27to do is preserve the boundary edges, so that the smooth version has the same
04:34silhouette, or profile, or outline as the original mesh.
04:39But in this case, we really want to make sure that that's off, so that we can
04:43properly smooth the edges.
04:44Once again, if I turn it back on again by typing in 1, you can see that we're
04:48getting yucky edges here.
04:50It's even more obvious if I turn Divisions up to 2. This really needs to be smoothed here,
04:56and again, the answer to that is to turn Keep Border off. Type in a 0, and there you go.
05:03That's the workflow for smoothing an nCloth object. If you are rendering in
05:07mental ray, you can use smooth mesh preview.
05:10If you rendering in any other renderer, then you'll want to drop a mesh smooth node,
05:14and adjust the attributes.
Collapse this transcript
Setting the initial state
00:00Currently our simulation is starting from a flag that's a perfectly flat plane
00:06on frame 1, and we could just choose to render from, let's say, frame 30 onward, and
00:13give that flag a chance to actually start blowing in the breeze, but that's not
00:18really the best option in a lot of cases.
00:21What we want is we want the cloth object to be fully simulated, and in its proper
00:27shape already on frame 1. It's really easy to do that.
00:32All we need to do is play the simulation through until we get to a point that we
00:38think looks good, and that will be the state of the cloth object on frame 1.
00:43So if I press Stop here now, and I'm on frame 200 and something, I can say this is
00:50the state I want the cloth to be in at the first frame of the simulation.
00:55Simply go up to the nDynamics menu set, and with the cloth object selected, go to
01:00the nSolver menu, and you'll see there's a submenu here that says Initial State.
01:06And we can do cool things in here.
01:08Right now what we want to do is Set From Current, and that means whatever the
01:14current shape of the cloth object is now, make that the shape at frame 1.
01:19I release the mouse, and when I rewind my timeline, I don't see any change, because
01:25now frame 1 has adopted the shape that was on frame 212, and when I press Play,
01:32it's already fully in motion on frame 1. We're not stuck to that; we can get rid
01:37of it, or we can overwrite it if we want.
01:39If we want to go back and start, you know, with a neutral slate once again, we
01:44can rewind, go to nSolver > Initial State, and clear the initial state, and that
01:50takes us back to whatever the shape of the object was when we first added the
01:54nCloth. And again, if we want it to be different on frame 1, some different state --
02:00maybe we like this shape better -- we'll just go back up to nSolver > Initial
02:04State > Set From Current.
02:07The nucleus initial state mechanism is far superior to that of the rigid
02:13bodies, or classic particles, in which you can set an initial state, but you can
02:17never remove it. But with nucleus, that's been fixed, so that we can remove
02:23initial states at will.
Collapse this transcript
Creating an nCache
00:00We're nearly finished with this simple flag exercise, and we're ready to render this out.
00:06However, we can't really render it just yet in this state;
00:10we need to do something called creating a cache.
00:13A cache is a storage.
00:16Basically what we're going to do is we're going to store the simulation data on
00:20disk, and that way when it's rendered, it will be reliable.
00:25We will get exactly the same result each time it's rendered.
00:30So we could use, for example, a render farm. We could have a hundred machines each
00:33rendering at 1 frame, and it would come out exactly as planned.
00:39If we don't cache the simulation, then it's anybody's guess what's going to happen.
00:44The simulation may run differently. It sounds kind of counterintuitive, but in
00:49fact, if you have the exact same scene file on two different computers, you may
00:53get a different result from the simulation,
00:56even if those two computers have the exact same specs, and that's really weird
01:01but it is a fact. The reason for that is that they're just so many variables; it's
01:06so complex that it's really not possible for it to be a 100% accurate every time.
01:12There's another problem if you don't cache your simulations, which is that they
01:16will take massive time to render an uncached simulation. The reason is that
01:23Maya's dynamics are history dependent, and what happens on frame 100 depends upon
01:29what happened on frame 99, and if you don't cache your simulation, what will
01:35happen is that Maya will have to calculate all of the frames leading up to the
01:39currently rendering frame for each frame.
01:43So if we're rendering frame 100, we're going to have to calculate all the frames
01:47from 1 to 99. Then when we move on to render frame 101,
01:51we'll after recalculate everything from frame 1 to 100. That means that as your
01:57batch render goes on, each frame will take longer and longer to render until it becomes absurd.
02:04The solution to these problems is simple:
02:06to get reliable playback, and faster renders, we'll just create a cache.
02:11Before I create the cache, I want to figure out what my time range is going to be.
02:16Currently I've got 600 frames, and I probably don't need all of that.
02:21I just want to create a shot that's, let's say, 5 seconds long, so I'll rewind, and
02:25I'll set my end range to 120 frames for 5 seconds at 24 frames a second.
02:33So I have got 5 seconds worth of animation here, and I just want to play it out,
02:38and make sure everything is fine.
02:39I'm not sure I'm 100% happy with the behavior of these constraints here, but I
02:43am going to go ahead and let it go.
02:46I'm ready to create my cache, and I have got the cloth object selected. I've got
02:50my timeline set to the appropriate range, and I'll go up to the nDynamics menu
02:54set nCache menu, and you'll see Create New Cache up at the top.
03:00Let's go to the option box for that, and what you'll see here is the Cache
03:04directory, and Cache name.
03:06What it's going to do is, inside your current project, there's a data folder, and
03:12it's going to store all the information in that data folder, and it's going to
03:17give it the name of the shape node.
03:20If you want to change that up, you can, but I'm just going to leave it right now.
03:24You'll also see File distribution One file per frame. What that means is we're
03:29going to get a 120 separate files, and that's actually what we want.
03:34Then we got the time range, and it's just set to the Time Slider by default. I'll go
03:39ahead and click Create.
03:41The simulation has to play through once to store the cache.
03:45Once that's done, now I can actually scrub through the timeline, and that's
03:50something I couldn't do before.
03:52Before I created the cache, if I tried to scrub through the timeline, I would get
03:56unpredictable results, or I may even get an error message that says nucleus
04:01evaluation has been skipped because you've jumped ahead too many frames. And
04:07that's all because, once again, the simulation is history dependent, meaning that
04:12what happens on frame 60 depends upon what happened on frame 59, and if we skip
04:16around on an uncached simulation, then it's going to break.
04:21Now, when you've cache your simulation, then you do want to save the scene as
04:25well. Let's take a look at the cache. I have already got it here. Here's my
04:30Exercise Files, and in that project folder, we go to data, and there's the folder for
04:36the nCache. Drill down in there, and you will see that we've got a file for each
04:41frame of animation. And these are really small; only 8 kilobytes per file. It's because my
04:48flag only had 600 quads on it.
04:51If your cloth object had a higher level of detail, then of course the cache files
04:56would be larger in size.
04:57I want to mention also here that nucleus is far more efficient at cache sizes
05:03than the classic particle system in Maya, which could end up giving you cache
05:09sizes in the range of gigabytes, but nCloth is really quite efficient.
05:14We've created that cache, but we can delete it at will if needed.
05:17We can just select the object, go back up to nCache, and delete it.
05:22We could also disable it as well, which would just temporarily turn it off
05:27without deleting it.
05:28You do have to delete the cache if you want to make changes to your simulation.
05:33If I don't delete the cache, then I try to make changes, then those changes will
05:37not be seen. Let's try that; Control+A. I go to my nucleus node, and turn the Wind
05:43off; I'll just hit Wind Speed to 0, Enter. Rewind, and play back, and apparently
05:50my wind is still blowing, and the reason is that the cache is completely taken
05:55over the simulation.
05:56I could change any and all attributes in the nucleus node, or in the nClothShape
06:00node, and none of that would be seen in the viewports, because the cache is doing
06:06all the work. It's basically playing back a movie of the simulation, and if we
06:11change any of these attributes, that's not going to change the cache, and it's not
06:16going to change the playback in the viewport as long as that cache is active.
06:20If I need to make changes, then I should delete the cache.
06:23I'll rewind back to frame 1. I have got currently a Wind Speed of 0. Go back
06:29up, and delete the cache, and play the simulation, and now we have got no wind. It's not optional.
06:37If you're going to render your shot, you have to cache it first, and then you
06:41also need to remember, it's very important, if you make changes to the simulation,
06:45those changes will not be seen in the viewport, or in the render as long as the
06:50cache is still active.
06:52If you need to make changes, you'll need to delete the cache, make your changes,
06:56and then rebuild the cache.
Collapse this transcript
Constraining component to component
00:00To get more realism for this flag animation, I'm going to attach the flag to a
00:06rope, which is attached to the flagpole, and as you can see, there is going to be a
00:12little bit of a gap here.
00:14It would be nice if we had some fasteners in there, but this will be good enough
00:18to show us how we can constrain one piece of nCloth to another using a component
00:24to component constraint.
00:26So to start off, I just want to select my flag, and disable the smoothing on it.
00:32Earlier I added a polySmoothFace1 node, so I'll go into the Channel box, and set
00:36its number of Divisions down to 0; that just basically disables the smoothing.
00:43And while I'm working, I also want to disable evaluation on the flag, so that I
00:47can focus on the rope.
00:49I'll go to the Attribute Editor, Control+A, and in that nClothShape node, up at the
00:54very, very top is Enable. I'll turn that off, and as long as that's off, then
01:00this cloth will not be evaluated.
01:02Let's focus on the rope now.
01:05What I've done is I've made a cylinder that has only three sides, but has about 30 segments.
01:12I don't need very many lines of longitude here, but I need lots of lines of
01:19latitude that are running parallel to one another, so that this will have enough
01:23level of detail to deform.
01:25So I'll just go ahead and create an nCloth on that.
01:28So with that selected, I'll go to nMesh > Create nCloth, and rewind, and play my
01:34simulation to see what happens.
01:36Okay, so that's good. It's falling with gravity, as a piece of rope should.
01:41Now I'm ready to constrain it to the pole.
01:44I'll go ahead and select that, and right-click, and choose Vertex component mode.
01:48I'll select these top three rows of vertices here, and go up to nConstraint, and
01:54do a simple Transform constraint, like we did before.
01:57I want to move that transform constraint icon up a little bit, so I can see it better.
02:03Rewind, and play back, and see what I get. So it looks like that's
02:06actually constraining.
02:07Let's finesse that a little bit.
02:09In my Attribute Editor, I want to select that dynamicConstrainShape node, and
02:14what I'm looking for is, just as before, this Strength Dropoff.
02:18I'm going to go ahead and create another point on that, and give that a
02:21Linear dropoff amount.
02:23What I need to do here is reduce the Dropoff Distance to, let's say, only 5
02:28centimeters. Play it back, and see what I get.
02:32I can increase the overall global strength. I'll scroll back up here, and you'll
02:36see Strength up here.
02:37I'm going to set that way up to 100 to make sure that constraint is strong
02:42enough. And if it's still not strong enough, we can play around a little bit with
02:47some of these other attributes, like the Dropoff Distance; maybe I'll increase
02:50that to 10. There we go.
02:53So that's stuck on there pretty well.
02:54I want to repeat that process for the bottom of the rope, so I'll go back down
02:58here, select it, right-click, go into Vertex component mode, select those bottom
03:04three rows, and once again, make an nConstraint transform, and just move it down,
03:11and once again, tweak the Strength Dropoff curve, change the Distance to maybe
03:17lke 5, or let's say 10 centimeters.
03:20Play it back, and see what's happened.
03:22So that appears to be actually constrained pretty well.
03:25But you can see that my rope is really stretchy.
03:29So I'll select that rope, and I'll try a Preset first of all. Let's go for
03:35standard tshirt preset, Replace that, and play it, and see what happens.
03:39It's still really stretchy.
03:41I want to go back down into those Dynamic Properties, and crank up the Stretch
03:46Resistance, and I'm going to turn it all the way up to, like, a 1000. That's a
03:52really high value, but I think I need a really high value in this case.
03:56That's behaving more like a real piece of rope.
03:59So I'll rewind that.
04:01Now I'm ready to constrain the flag to the rope, and what I need to do here is I
04:06need to select vertices on both of the objects.
04:09I'll select the flag, right-click, and go to Vertex mode, and select a range of
04:13vertices here, and then I want to go over to the rope, and right-click on that,
04:19and choose Vertex mode, and hold down the Shift key, and select another three
04:24rows of vertices here.
04:27So I've made my two selections, and I'll go ahead and add the nConstraint.
04:31nConstraint > Component to Component, and activate that. And you'll see I don't have
04:38any little locator icon or anything to indicate that.
04:40I'll rewind, and play it back, and I don't see anything now, but that's because my
04:45flag is currently turned off.
04:47I want to go back into its shape node, nClothShape node, and reenable
04:53evaluation, and play that back.
04:55And now we're seeing the constraint.
04:58That's pretty good.
04:59We need to repeat that process at the bottom.
05:03Right-click and go into Vertex component mode, select some vertices, right-click
05:07on the flag, and go to Vertex component mode. Hold down Shift, and select
05:12these three rows of vertices here, and once again, add nConstraint > Component to Component.
05:20Press Play, and see what I get.
05:23I'm pretty happy with that.
05:24Now, I want to let you know that it took me a long time to get the right settings,
05:28and tweak this out to make it work, and you will see that in your own scenes,
05:33you'll need to spend massive amounts of time tweaking things, and getting the
05:38exact perfect storm of attribute values and selections in order to get the
05:43result that you want.
05:45Here's an example of the kind of problems that you'll need to solve with nCloth,
05:50and you'll need to spend some time, and some creative thought process to try to
05:55find the problem, and fix it.
05:57You can see here that my rope is stretching in really kind of strange ways.
06:02Of course, we can play around with some of these Dynamic Properties.
06:06Stretch Resistance is 1000.
06:07I'm going to turn the Compression Resistance up to a 1000 as well, and I'll set
06:13Band Resistance to just a value of 1.
06:16Rewind that, and play that back, and you would think that that would be good
06:20enough to solve it, but as we can see, clearly it's not good enough.
06:23Rewind that, and what I found through playing around for quite a long time was,
06:29it turns out it was the Mass. Set that to a value of 2, and then press Play.
06:35And once the simulation settles down there, we're getting a much better result there.
06:39And it's probably okay.
06:41When we smooth this, and we see it from a little bit of a distance, no one would
06:46know that there was any issue at all.
06:48And that concludes our chapter on directing nCloth.
Collapse this transcript
4. Optimizing Performance
Duplicating nCloth
00:00In this chapter, we're going to look at optimizing performance in various ways.
00:05The first thing I want to show you is how to duplicate nCloth systems.
00:09If you spend a lot of time making something work, then you just want to
00:13duplicate that instead of recreating it, and redoing all that work.
00:18Duplication is not really a straightforward process here, so we have to kind of
00:22figure out how it works.
00:23If your remember back to much earlier in the course, I made a backup of this
00:27mesh object before I turned it into a cloth, and it's here on the backupLayer;
00:32just make that visible.
00:34So that's my original mesh shape before any cloth was applied to it.
00:40This is just a backup. It's a safety.
00:42In case I get in trouble, I can always go back to this mesh object.
00:45I am going to re-hide that.
00:47So to make a duplicate of an nCloth, you can't just use the standard, ordinary,
00:52plain old Duplicate command.
00:54So if I just go to Edit > Duplicate, or hit Control+D, then essentially what I'll be
00:59making is a snapshot, and it won't be dynamic.
01:03So when I press Play, you'll see that's not moving.
01:05And if I look at the attributes for that, Control+A, you'll see that it's just a
01:10mesh; it doesn't have any connections to an nClothShape, or a nucleus node.
01:15You'll also notice that, confusingly, there are actually two mesh shape nodes here.
01:20That's the underlying structure of an nCloth object.
01:23It's actually got to have the original mesh, and the output mesh, which is after
01:28all the dynamic simulations have been applied.
01:31And it's just a weird quirk of the Maya software that when I make a duplicate
01:36of an active nCloth object, the new duplicate is going to have two shape nodes as well.
01:43Even though we don't need two shape nodes, we get an extra one for free.
01:47Again, don't let that confuse you;
01:48if you make a duplicate of an nCloth object, you actually can't get rid of
01:52this extra shape node.
01:54So I'm going to delete that, because that wasn't what I wanted.
01:57I want to make a duplicate that is dynamic.
02:00Additionally, I want to make sure that I select not just the flag, but anything
02:04that's connected to it.
02:05I've got some transform constraints here too.
02:08I need to select those as well in order for this to really work properly.
02:12And while I'm at it, I might as well select my passive collider, which is the flag pole.
02:16I'll just select all four of those objects.
02:19And instead of standard, plain vanilla Duplicate, I want to do Duplicate Special,
02:24which is under Edit > Duplicate Special, and we have to go into the Options.
02:30Now I'm going to reset the options to show you what they would look like with no change.
02:34This is the default, and if we use the default in this dialogue, then it will act
02:40just like an ordinary, plain Duplicate command.
02:43What we need here is to not just make a snapshot, but to make a dynamic copy.
02:49We need to toggle on this switch here that says Duplicate input graph.
02:54Now, what does this mean? The differences between Duplicate input graph, and
02:58Duplicate input connections?
03:01The difference is whether you've got a shared history or not; whether all the
03:05input nodes are shared between the duplicate, and the original.
03:10If I chose Duplicate input connections, I would have a shared history. The two
03:15shape nodes would have the same construction history. They would have all the
03:19same input nodes, basically making a branching structure.
03:23What I want here is a completely new history.
03:27That way, I can have two completely different flags that behave differently, so
03:32Duplicate input graph.
03:33I'll go ahead and click Duplicate Special.
03:36When you do this, if you're not parked on frame 1, you might see some strange
03:40result, like I'm seeing here.
03:42I do want to make sure I rewind back to frame 1.
03:45The duplicates are currently selected, so I can go ahead and just move that over.
03:49And I'll press Play, and you'll see at first that they look the same, but they're
03:55actually not the same, and if we let this play long enough, we'll start to see
03:59that they kind of deviate.
04:01If we wanted to shortcut this process, what we could do is we could just disable
04:05Solver evaluation for one of those, and play it for a few frames, and then
04:10re-enable Solver evaluation, and then we would have two different flags.
04:14I'll go ahead and hit Control+A, and I want to select just that flag, and just
04:20toggle the Enable state off for a second, and then just play this through for a
04:26few frames until we are sure that these two are not matching any longer, then I can reenable that.
04:33And then when I play this back, you can see that we're not getting the exact
04:37same result on these two.
04:39And of course, since they are two independent objects, they could have different
04:42materials, and they could have different properties; I could play around, and make
04:46one of them lighter, or whatever.
04:48All I really want to do here, just for clarity's sake, is just to assign a new material.
04:53Just really quickly, I'm going to do Assign New Material, and make that a Lambert
04:57material, and I'll rename this, and I'll call this one flag2Lambert.
05:03In the Color channel, I'll click Create Render Node, and create a new File node,
05:08and then browse, and I've got flag2_cmy.
05:14Now I've got two completely different flags, and they started off having the same
05:18properties, but the simulation is going to be different.
05:21So that's the process of duplication for nCloth.
Collapse this transcript
Assigning Nucleus solvers
00:00Sometimes, when building dynamic simulations, we'll want to have more than
00:05one nucleus solver.
00:07For example, let's say we wanted one of these flags to be blowing in the wind,
00:10and the other one standing still.
00:13The way to accomplish that would be to have two separate nucleus solvers.
00:17When I duplicated the flag in the last movie, I actually duplicated the nucleus
00:22solver in the process, and so it's actually set up now for two different nuclei.
00:29If I select this flag, and hit Control+A, you'll see it's connected to nucleus1.
00:34If I select the other flag, you'll see it's connected to nucleus2.
00:39So in fact, this is already set up.
00:40I could turn the Wind Speed down to 0 for nucleus2, and then rewind, and play my
00:46simulation, and you'll see that we only have wind on one of the flags.
00:50That's pretty helpful.
00:53If you wanted to use just one nucleus solver for both of those objects, what you
00:58would do is you would select the object, and go up to the nSolver menu > Assign
01:03Solver, and then choose the Solver, and now both of those are connected to
01:09nucleus1. So you can see I have selected that, and we see nucleus1 here;
01:14select the other flag, and again, it's nucleus1. Rewind, and play back, and we are
01:19back to they're both sharing the same wind settings.
01:22I got my second nucleus node for free when I duplicated special.
01:27If you want to create a new nucleus node from scratch, what you would do is
01:32you would select your object, and then go up to nSolver > Assign Solver, and New,
01:39and it would create another nucleus node, and connect the selected object to
01:43the new nucleus node.
01:45I'm not going to bother doing that now, because we've basically illustrated our point here.
01:49So that's how you can work with more than one nucleus solver.
01:53This can sometimes help you, not just for special effects, but also for
01:57fine-tuning. Maybe the two objects need to have completely different nucleus
02:02Solver settings; maybe we need to go in here and have different settings for the
02:07Substeps and Collusion Iterations.
02:09Creating two different nuclear solvers is the way to accomplish that.
Collapse this transcript
Using collision layers
00:00As you start adding more and more nCloth elements in your scene, the performance
00:05will start to degrade pretty quickly, and you'll need to take some special steps
00:09to improve the performance.
00:12Here I've got six flags, and they're all sharing the same nucleus node, and they
00:17all have the same settings to their nClothShape nodes.
00:21And when I play, you will see that we're getting approximately 10 frames per second.
00:25But we can improve this, and we can get closer to real-time playback by using
00:30something called collision layers.
00:32We can set it up so that certain objects are not allowed to collide with other
00:36objects, and that would help with performance, because it would reduce
00:40unnecessary calculations.
00:41For example, none of the flags are ever going to touch one another, so it'd be
00:46a smart thing to disable the ability for the flags to collide with one another.
00:52Likewise, each flag will only ever be able to collide with it's own flagpole, so
00:57we can make it so that this flag won't collide with any of the other flagpoles.
01:01This is done using collision layers.
01:04If I select any nucleus object, and hit Control+A to open up the Attribute Editor, I
01:09can go to the nucleus node, and you'll see in the Solver Attributes section,
01:14there's something called Collision Layer Range.
01:17And this value determines which collision layers are allowed to collide with
01:21one another. The collision layers are set on a per nCloth, or a passive collider basis.
01:29In other words, if I go to the nClothShape node, there is a Collision Layer field
01:33here, and there is also one for the nRigid shape, or the passive collider,
01:38Collision Layer here.
01:40Now, at first you might think that if you just simply put these two objects on
01:44the same Collision Layer, and these two objects on a different Collision Layer,
01:49that would be sufficient to prevent them from colliding.
01:52Unfortunately, in Maya, a lot of times things just aren't that simple.
01:57We need to not only set Collision Layer values for each object, but we also
02:02have to set, in the nucleus node, this Collision Layer Range value.
02:07This gets a little bit weird, because you would think that if I set the Collision
02:11Layer Range down to 1, that would mean that something on Collision Layer 0 would
02:18not be allowed to collide with something on Collision Layer 1, but in fact,
02:23that's not the case.
02:24In order to prevent two things from colliding, their Collision Layer difference
02:29must be greater than this Collision Layer Range value.
02:34If the value is 1, then the two collision layers have to have a difference of greater than 1.
02:42So that's the trick to this.
02:45I've got Collision Layer 0; I'll just leave that as the default for these two
02:49objects. And then the next one down, I had to set the Collision Layer to a value
02:56that is greater than the Collision Layer Range.
02:59If I just set this to a value of 1, this flag would still collide with his flagpole.
03:06This has to be set to the value of at least 2.
03:10I'm going to go down the line, and I'm going to change these all.
03:13These two will have a Collision Layer of 2. The next two will have to have a
03:18Collision Layer of 4.
03:20Go ahead and set those, and the next pair has a Collision Layer of 6. So
03:27each one of these has a Collision Layer that is a value that is two greater than
03:33the previous Collision Layer.
03:37That's all been done.
03:38Now I'll go back to my nucleus node.
03:40Now let me set the Collision Layer Range up to the default value of 4, and play
03:45that back, and see what we get.
03:47We're getting a little bit of a performance improvement.
03:50Remember that before we changed the collision layers, we had a playback speed of
03:54about 10 frames per second, and now we are getting about 11.
03:57What I want to do here is reduce the Collision Layer Range down to 1.
04:02Rewind, and play that back.
04:05And now I'm getting a playback speed of more in the range of 16 frames a second.
04:10That's a pretty substantial improvement; going from 10 frames per second to 16
04:15frames per second is significant, and that could make all the difference in
04:19interactivity in a scene.
04:21The faster the playback is, the better you're able to evaluate, and make
04:26changes to your simulation.
04:28Now, if I set the Collision Layer Range up to a value of, let's say, 20, then
04:32that's essentially disabling all of the benefits, because now any Collision Layer
04:38that is less than 20 from another Collision Layer will be allowed to collide.
04:45Play that back and now I'm down to 10 frames a second once again.
04:50This is my advice is set the Collision Layer Range to a value of 1, and then
04:56make sure that each Collision Layer is 2 greater than the previous Collision
05:01Layer, and that will ensure that none of those are colliding.
Collapse this transcript
Optimizing nCloth quality settings
00:00Let's take a look at the nClothShape node quality settings.
00:05Previously, we looked a little bit at the Nucleus global solver attributes,
00:10and these settings have to do with how many calculations are made per frame, and
00:16how many times vertices are tested for collisions, and higher numbers will give
00:21you allegedly better results, but will take longer to calculate.
00:26If I play this back, you'll see we're getting about 17 frames a second currently.
00:32But in this version of the flag, I've made the Stretch and Compression
00:35Resistance lower, so that we see some unfortunate stretching there. We want to get rid of that.
00:41I will go to the shape node, and I want to find the Stretch Resistance, and
00:47Compression Resistance, and I want to crank that up to a pretty high value of 500.
00:52The slider only goes up to 200, but I'm going to crank it up even further, and
00:57play that back, and see now I've got a pretty solid cloth.
01:01It's not stretching, or doing anything strange, but my frame rate has gone down
01:06to 10 frames a second.
01:09What's happening here is that as we increase these Dynamic property values to
01:14higher and higher numbers, then more and more calculations must be made.
01:19Well, what we can do is we can set an upper limit on that, so that it won't take
01:24as long to calculate, and we will have faster performance in the viewports.
01:28And this can be set on a per object basis inside that shape node, once again.
01:34Scroll down, and you'll find there's a section that says Quality Settings.
01:39And the important attribute currently here is Max Iterations; that's the maximum
01:45number of the times these Dynamic Properties will be calculated.
01:49And the default value is 10,000, which essentially really means there's no limit
01:53to the number of calculations.
01:55You won't reach 10,000 iterations very easily;
01:58you'd have to crank up all those values very high to get to that point.
02:03So again, with the Max Iterations at 10,000, I'm getting about 10 frames per
02:07second in my viewport.
02:10I can reduce this down. Let's try a really low value, like 10, and then we'll
02:16rewind, and press Play, and see what we get.
02:19And what we're seeing here is better performance; we've got now about 15 frames
02:23per second, but now it's getting stretchy. Now why is that?
02:27It's because we've set the iterations so low that the Dynamic Properties are not
02:32being fully calculated.
02:34We're not able to get a stretch resistance of 500, because we've kind of limited
02:40that ability by knocking the Max Iterations down so low.
02:43What we need to do is just find the right value that's going to give us
02:48a performance benefit, but is not going to negatively impact the look of our simulation.
02:52And I toyed around with this a little bit earlier, and settled on a value of
02:56about 50 seemed to give me the sweet spot in this case.
03:01But again, it's going to be different for every scene.
03:04So now I've got a Stretch and Compression Resistance of 500, and I'm not seeing
03:09any stretching, and I've now got a frame rate of 13, which is a good compromise.
03:15You can set this for every object in your scene differently if necessary.
03:20That's one way to tweak the quality, and to get better performance in your
03:23viewports for nClothShape nodes.
Collapse this transcript
Displaying nodes in the Attribute Editor
00:00By default, a lot of the nodes that you would normally expect to see in the
00:04Attribute Editor are hidden for nCloth objects, and that's just to streamline the
00:10display, and to hide anything that is less essential, to make room for more
00:15important things, like the nucleus node.
00:18If I select the nCloth object, and hit Control+A to open the Attribute Editor,
00:22you'll see that indeed I've got access to the nucleus node, the shape node, and a
00:27couple other nodes, but I don't see my material nodes, and I don't see the
00:32constraint node, for example, that I know is actually connected to this object.
00:37We can make those nodes visible in the Attribute Editor very easily.
00:41We'll just go up to the nSolver menu, and you'll see there's an entry here that
00:46says AE Display; that's Attribute Editor Display. And we can just enable the node
00:52types that we want to see.
00:54I'll turn on Material Nodes, and now I've got my Lambert shader, or Lambert material.
01:00Likewise, I can go back up into nSolver > AE Display, and enable dynamicConstraint
01:05Nodes, and now the dynamic constraints that are attached to this object are going
01:11to be easily accessible in the Attribute Editor.
01:14Just a simple thing that will streamline your workflow.
Collapse this transcript
Displaying the input or output mesh
00:00Let's go a bit deeper into the structure of nCloth.
00:04nCloth is made out of two meshes, in fac; the input mesh, and the output mesh.
00:10When you create an nCloth object, you'll only see the output mesh; you'll
00:14see the end result of this simulation. That's what we have here with this simple tablecloth.
00:19We can display the input mesh, which is the original object; the original
00:23polygon mesh before the simulation. And to some extent, we can make limited
00:28changes to that object.
00:30I am going to go ahead and display the input mesh.
00:33I'll select my nCloth object, and go to the nMesh menu, and choose Display
00:38Input Mesh, and it changes color there, because I actually had two different
00:43materials assigned.
00:44So now we can make some changes, in fact, to this input mesh, with some limitations.
00:50Certain tools won't work; for example, the Interactive Split tool doesn't work.
00:55But I am going to use the Cut tool, and we'll just chop off pieces of this tablecloth.
01:00I am going to go into the Polygons menu set, and I'll need to select some
01:04faces. Go into Face component mode, select all those, and I'll go up to Edit
01:12Mesh > Cut Faces Tool.
01:14I am going to do something a little bit clever by going into the Options, and
01:18enabling Delete cut faces.
01:20And then when I drag across here, you'll see I have not only the ordinary cut
01:25line, which is the solid line, but also that dashed line, and that indicates which
01:30side of the object is going to get cut off.
01:33So I want to actually spin this around, so that it's pointing the other way.
01:37And when I release the mouse, that object is cut, and all those extra faces are deleted.
01:43So if I want to do it again, then I would want to go right-click, and go back
01:47into Face mode, and select the faces, and reinitiate that Cut command; it's still
01:53here in my Most Recent tool. Click on that, click and drag, set the orientation
02:00of that dashed line, release the mouse, and all of that gets deleted.
02:05And then go back to Object mode, select that object, and go back to the
02:12nDynamics menu set, and nMesh, and I'll go back to displaying the output, which is
02:17called Display Current Mesh. Rewind, and play my simulation, and then now I've got
02:23a tablecloth that's been cut up.
02:24However, it won't work in all situations.
02:27If you've got constraints applied, then this isn't going to work, or if you've
02:32made any kind of vertex selection on that nCloth object, then it's not going to work.
02:37Let me show you by going to a different scene file of the flag.
02:41I am going to go to File > Open Scene, and I've got
02:45displayingInputOrOutputMesh_flag. Open that up.
02:49I am not going to bother saving this. And I can still display the input and
02:53output mesh, just as before, but I am going to have problems if I make any
02:58changes, because I've selected by vertex here to apply that transform constraint.
03:04I'll go up to nMesh, and Display Input Mesh, and now here's our original plane.
03:10And I could go into Face mode, for example, and delete some faces, cut a hole in
03:15my flag; just press Delete. And it seems okay, until I go back into Object mode,
03:22reselect it, and then attempt to display the current mesh once again. And notice
03:28as soon as I did that, the points on my constraint have all moved around.
03:32So these little purple dots here; those represent the points that were selected
03:36for the constraint, and when I press Play, it's a disaster.
03:41Basically, you can't make topology modifications on input meshes that have
03:46constraints applied.
03:48You can't change the number of points on the object, because the constraint is
03:53applied by vertex ID. Every polygon object in Maya has vertices that are
03:59uniquely identified by number,
04:02and when you change the number of vertices on a mesh, then all of the vertex ID
04:07numbers get shifted around, and that's why the constraints no longer applied in
04:11the same physical location, because what was vertex number 2 over here, is now
04:17vertex number 2 over there.
04:19For very simple situations, you can make changes to the input mesh, but if
04:25you've got constraints, or any kind of fancy stuff applied, then you can't change
04:29the topology of the input mesh.
Collapse this transcript
Working with construction history
00:00Occasionally, you may have a need to adjust the construction history of an
00:05nCloth object; for example, to increase the level of detail.
00:10Here is an example.
00:11I've got a tablecloth here that just doesn't have enough detail to really be convincing.
00:15Now, I did not delete the construction history when I created that plane. I just
00:21built the plane, set the number of vertices that I want by setting the number of
00:25segments, and then made an nCloth out of it, and it worked.
00:30But now I've decided that I don't have enough detail, and I need to go back and increase that.
00:35Normally, what you would do is, of course, you would just select the object, and
00:38then drill down into the Channel box, or the Attribute Editor to find the
00:42primitive node; in this case, it's a polyPlane primitive.
00:46Well, once it's been converted to nCloth, you can't get access to that very easily.
00:51If I hit Control+A to open the Attribute Editor, you will see that I have got lots
00:56of stuff here. I have got my nucleus node, and I can even see the material node,
01:00because I've made that visible, but I can't get access to the polyPlane node
01:05that I know is here.
01:06Well, here's how you can get access to that.
01:10You'll want to select the object, and display its input mesh.
01:13I am going to go into nMesh > Display Input Mesh, and having done that, now this is
01:19no longer dynamic. This is the original polyPlane, but strangely, and weirdly the
01:25polyPlane primitive node that I know exists is not showing up in the Channel
01:30box, and again, it's not showing up in the Attribute Editor either.
01:33Now, this is to try to protect us, so that we don't actually mess up our simulations.
01:39Similarly to what we saw in the last exercise, if I change the level of detail
01:43on an nCloth object that had vertex level selections, that would cause the
01:48simulation to break, because all the vertices would shift around on the model, and
01:53different areas would be selected.
01:56So that's why the input nodes are hidden by default, is because in most cases,
02:00you really shouldn't be changing the input nodes.
02:03But here, because it's such a simple object, there's no reason why I can't do that.
02:08It's not constrained to anything, and it's just a polygon plane.
02:12So how do we get access to that polyPlane node?
02:15We need to display the input mesh, and then also go into either the Hypergraph, or
02:21even better, the new fancy Node Editor, which exists in Maya 2013.
02:25I have got my object selected. Go to the Window menu, and I can choose Hypergraph:
02:31Connections, which is the old school method, or the Node Editor; let's open that up.
02:37The Node Editor is a little bit fancier version of the Hypergraph that makes it
02:41easier to make connections, and easier to see what you're working with.
02:45In order to now display the graph of the currently selected object, which is
02:50a tablecloth, I'll need to click this button here: display the Input and
02:54output connections.
02:55Once I've done that, I can see now the scene graph for that object, and here it
02:59is: the polyPlane node. The one that's been hidden from us.
03:03I can select that, and now I've got access either through the Channel box, or
03:07the Attribute Editor.
03:09I can change the number of divisions now;
03:11let's try 50, and 50.
03:14Now I have got a lot more detail on that.
03:16I'll select the object, go back to the nMesh menu, and Display Current Mesh.
03:22Rewind, and play back, and there you go; I have got a much better mesh.
03:27Now, there are some quality issues here that I haven't resolved, but you see the
03:31principle here, which is I do actually have the ability to change the
03:35construction history on an nCloth object, if that history exists.
03:40I just have to display the input mesh, and then open up the Node Editor, or the Hypergraph.
03:46One more thing that's kind of important is the ability to delete the
03:49construction history for performance reasons.
03:52Let's say you have done a lot of edits to a polygon object, and it's got a long
03:56history, with lots of cut commands, and extrude commands, and all kinds of stuff
04:00in there, and then you forget to delete the construction history, and then add an nCloth to it.
04:06You are going to have slower performance, and you'll want to delete the construction
04:10history before you apply the nCloth.
04:12Well, if you forget to do that, it's not a problem, because you can delete the
04:16construction history after the fact if needed.
04:19Currently, I've got a polyPlane node in there that I want to get rid of.
04:22Well, if I use the standard delete construction hmethod, then that's
04:27going to delete my nCloth as well.
04:29If I go to Edit > Delete by Type > History, that doesn't delete the polyPlane node
04:36alone; it deletes all of the input nodes, including the nCloth.
04:40So when I press Play, I don't have a dynamic simulation anymore.
04:44Ironically, it's still running slow.
04:47I am going to undo that couple of times, Undo "DeleteHistory", and now I'm back
04:52to the dynamic version.
04:54If I want to delete the construction history prior to the application of the
05:00nCloth, then there's a command for that here in nMesh > Delete History, and then
05:06play that back, and it's fine.
05:09So now there's no longer any polyPlane node, and I am just left with a raw
05:15mesh on my input. And if I go back to the input mesh, and go back to the Node
05:20Editor, and click on display input and output, there is no longer a polyPlane node there.
05:27I have successfully deleted my construction history after having created
05:31an nCloth node.
Collapse this transcript
Extruding nCloth
00:00nCloth is designed to work with two-dimensional surfaces.
00:04You can use nCloth on a surface that has some thickness, but it's kind of hard
00:10to control sometimes, and what you'll have happen a lot is that the thickness
00:15will not be maintained, and it will actually sort of collapse on itself.
00:19And that's problematic, because obviously in the real-world, cloth has some
00:24thickness, and especially in a close-up shot, it's not very believable if the
00:27cloth is infinitely thin.
00:30But we need to calculate the simulation based upon an infinitely thin
00:34two-dimensional surface.
00:36And to get the thickness that we want, we can just extrude the mesh.
00:41I'll rewind my simulation back to frame 1, and select that mesh.
00:45We're currently seeing the output of the simulation; not the input mesh.
00:50We want the extrude node to be applied after the simulation, and that way,
00:56we won't add more detail to the input mesh, which is then feeding into the simulation.
01:02In other words, if we extruded it before the nCloth node, then it would sort of
01:08collapse in on itself, and it would also be much slower.
01:11What we want is to apply the extrude after the simulation.
01:15I've got my object selected.
01:17I'll just go to Polygons menu set, and go to Edit Mesh > Extrude.
01:22And as always, with the extrude node, you have to give it some non-zero
01:26thickness; you have to remember to increase the thickness some amount.
01:30If you just leave it alone, and don't increase the thickness, you'll have an
01:34extrude of zero, and that will be an illegal object, which will have two
01:39coincident planer surfaces that are sitting right on top of each other.
01:43Currently, it's got a value of about 1 centimeter.
01:45I'll go back to Object mode, and select, play back; there you go. We have got thick cloth.
01:54If we want to change the thickness, we can just go into that extrude node. I'll
01:59get in real close, so we can see that, and you will see polyExtrudeFace, and
02:03that's happening after the nCloth shape.
02:05Remember that the Channel box displays nodes from bottom to top. That means this
02:12polyExtrudeFace is stacked on top of the ClothShape node.
02:16We can open that up, and maybe reduce the Local Translate Z, which is the
02:21thickness. Maybe I'll set that to .5.
02:25Notice that I extruded my cloth upward, and not downward.
02:29If I had a Local Translate that was a negative value, then we would get
02:33interpenetrations with that collision object underneath.
02:37We can't see that now, but in some cases, it could be problematic.
02:40I am going to reset that back to 0.5.
02:44Additionally, there's nothing to stop us from smoothing this as well after
02:48it's been extruded.
02:49We can just go ahead and select that mesh, go into the Polygons Mesh menu, and
02:54drop a Smooth node on it, and that looks pretty good. I have got a pretty
02:59convincing tablecloth now, with some thickness.
03:02Later in the course, we'll see how you can create a separate object that
03:06has thickness, and then use a wrap deformer to connect that to a
03:11two-dimensional nCloth surface.
Collapse this transcript
Increasing efficiency with proxy collision objects
00:00A simple way to improve performance is to use proxyCollisionObjects.
00:05Using a high detail mesh as a collision object is unnecessary, because it's just
00:10going to bog down the system, and your simulations will run more slowly.
00:15Currently, what I've done here is I've got a dining table that's a high
00:20detail mesh, and I've also made a proxy version that's just made out of simple primitives.
00:25This one here; let's check its Polygon Count. Display > Heads Up
00:29Display > Poly Count.
00:31It's 30,000 triangles, so that's kind of heavy.
00:35Turn that back off again; Display > Heads Up Display > Poly Count. And I have
00:39put that on a layer.
00:41Let me just hide that layer, and show you I created a very similar version that's
00:46just super low polygon, and that's just there for collisions only; it won't be
00:51in the rendered movie.
00:53So let's see what the performance gain will be.
00:56Here is my cloth. I am going to go ahead and make that into an nCloth.
01:00nMesh > Create nCloth. Select it, and go into the Attribute Editor, and for the
01:06shape node, I want to choose the Preset tshirt. Replace, and since this scene is
01:12built at 1 to 1 scale, I'll need to go into the nucleus node, to the Scale
01:16Attributes, and set that Space Scale down to .01; press Enter.
01:23Check the simulation to see if it's working right. It seems to be working okay; good.
01:27Now let's see what happens if we collide with this high detail dining table.
01:34We've got it selected, we'll go up to nMesh > Create Passive Collider, and I'll keep an
01:40eye on my frame rate down here.
01:41Press Play, and I'm getting something on the order of about 3 frames per second.
01:50Let me extend my timeline a little bit here, because the best test of this is
01:54when the cloth is settled down, and is no longer in motion.
01:58While it's in motion, the frame rate is going to fluctuate a lot.
02:01I am getting 3.6 frames per second.
02:04Now let's see what happens if we collide with the proxyLayer instead.
02:08I am going to select that dining table, and remove the nCloth,
02:12nMesh > Remove nCloth.
02:15And this is really the only way to do this unless you want to make a duplicate,
02:19and delete the original.
02:20Now it's no longer a passive collider.
02:22It seems to be working okay, and let me just hide that temporarily, and make my
02:27proxyLayer visible. And this is made out of four separate objects; I am going to
02:31select them all. nMesh > Create Passive Collider. Rewind, and play that back, and
02:38let that settle down.
02:40And you see we are getting somewhere on the order of 5 frames per
02:43second instead of 3.
02:45So that was an appreciable increase in performance.
02:50For our final rendering, of course, I want to increase the Friction, or the
02:54Stickiness, so that that doesn't fall off; play that back.
03:00And I don't want to see the proxyLayer at all, so I can just hide its
03:04visibility, turn on the renderableLayer, play that back, and we are good to go.
03:10And you can follow this same principle with anything, whether it be a character
03:14that needs to collide with cloth, or whatever you might need to do.
03:17If it's a high detail mesh, you don't want to use that as a collision object.
03:21Make a proxy object that's the same sort of shape and size, and use that to
03:25collide with your nCloth.
Collapse this transcript
Modeling nCloth garments
00:00A final note about optimization, and this is a really important one.
00:05When you are modeling nCloth objects, you need to follow certain rules, so that
00:11you don't have problems later down the line, especially when you're going to be
00:14clothing an animated character.
00:16I have made this simple robe here for this character,
00:20and I just want to point out to you how I've tried to observe the same rules in
00:26modeling this that you would observe when modeling a character if you're going
00:30to be using subdivision surfaces.
00:32I have got the 3 key, or smooth mesh preview enabled here. I'll press the 1 key
00:37so we can see the original base mesh.
00:39Just like when you're modeling a character, you want to try to use all
00:43quadrilaterals throughout.
00:45You want to try to avoid triangles, and try to avoid n-gons, which are polygons
00:50with more than four sides.
00:52You won't be able to completely avoid triangles; as you'll see here, I have got a
00:56few of them scattered around.
00:58Those triangles are there to try to fit quadrilaterals together, and to make a
01:03graceful transition between areas of higher and lower detail.
01:07I have got an edge loop running down here, and it needed to split in order to
01:12give me enough detail down here towards the bottom of the robe.
01:17Just basically the same rules that you would observe with character modeling. It
01:21should be all quads if possible, no n-gons, try to avoid poles, which is where
01:26you have more than four edges meeting at a single point.
01:30I have got a few poles in here, as you can see, but this is not bad for an nCloth object.
01:37It could be more detailed, but I wanted it to be simple for the purposes of our lesson.
01:43You'll need to model your cloth to the character, and you'll need to do that
01:48while the character is in a neutral bind pose, like this traditional T-pose.
01:53The T-pose is probably the best choice.
01:56You can recycle assets, but you may need to tailor them to the individual
01:59character before trying to create the nCloth.
02:03It's difficult to change the structure of a model after you've created the
02:08nCloth. As we saw earlier, you can do it as long as there are no constraints
02:13applied, but it's really common that you'll need to have all sorts of
02:18constraints, and other elements on an nCloth skinned character.
02:22That basically finishes our chapter on optimization, and in the next chapter,
02:26we'll look at integrating nCloth with animation.
Collapse this transcript
5. Integrating nCloth with Animation
Welding adjacent borders
00:00This chapter is all about integrating nCloth with animation, and that
00:04generally means applying clothing to a skinned character; a character that's
00:09driven by a skeleton.
00:11In the first couple examples here, I've just got a static mesh. This guy doesn't
00:16animate; he's just basically a statue,
00:18but we'll work our way up to an animated character.
00:22The first thing to do, of course, is to create nCloth, and since I've got the
00:26character selected, I'll go ahead up to the nMesh menu, and make him a passive
00:30collider. Then I'll choose the robe, and choose nMesh > Create nCloth.
00:37Select it again, go to the Attribute Editor, Control+A, if it's not already open, and
00:43I'm just going to choose a different preset.
00:45Presets; let's try the tshirt, and Replace all those attribute values.
00:51If I play this now, it won't look like much; it's going to look kind of strange,
00:55and it's because the scale is wrong.
00:58My character is modeled at a 1 to 1 real world scale.
01:01We rewind that, go back to the Attribute Editor, to the nucleus node, and I need
01:08to find the Scale Attributes, which is down near the bottom. Open that up, and
01:12you'll see Space Scale. We need to set that to .01.
01:15Remember that a model that's built at 1 to 1 scale will require a Space Scale of
01:22.01. Press Enter, play that back, and there we go.
01:28Now we've got cloth draped over the character.
01:31And we are getting pretty good frame rates here too of about 12 frames per
01:35second, and that's not bad considering the complexity of this. Just to make that
01:40little bit prettier, I can press the 3 key, and you can see that that's now
01:44smooth; that'll be better when it's rendered.
01:47So, for modesty's sake, we want to keep his robe closed. I am going to go ahead and
01:51hit the 1 key, and go back to just the polygon mesh display instead of this
01:55smooth mesh preview.
01:57And what I want to do is apply a constraint that will keep this closed here.
02:02So there's two separate borders here; there's a row of edges here on one side,
02:07and another row of edges on the other side, and I'll use a constraint to
02:11essentially sew them together.
02:12I want to select the edges. I'll right-click on the robe, and choose Edge
02:18component mode, and this is all actually one constant border all the way around.
02:24I can double-click anywhere on any of these, and that selects the entire border.
02:30But I need to deselect everything that's not in the front here.
02:33I'll hold down Control, and drag a rectangle to deselect some of these, not
02:40forgetting the ones at the bottom too, because that border goes all way around.
02:45Let's do this in Wireframe mode with the 4 key.
02:48Hold down Control, and deselect all of those. Check your work. Tumble around in the
02:54view. Make sure that you haven't selected any other edges, just those in the
02:59very front. Hit the 5 key, and now I am ready. I can go ahead and issue the
03:04command, which is an nConstraint > Weld Adjacent Borders, and this will only work,
03:11of course, if the two sets of edges are close to one another.
03:15We don't want to weld borders that are distant from one another. I'll go ahead and
03:19release the mouse, and activate that.
03:21Now you'll see all these little green dots indicate there's a constraint in effect.
03:25I'll rewind, and play my simulation, and boom!
03:30He's been clothed. And we can set this up in various ways, too. We can make it so
03:35we could open or close the robe.
03:37You could use that constraint method also to sew together parts of a garment.
03:42Maybe you've modeled the trunk of the robe separately from the arms.
03:46You can sort of just place them next to each other, and use that constraint in
03:51order to sew them together.
03:53However, for best results, you're going to make sure that, just like with any
03:57joint you create in a model, that the number of vertices is the same, and the
04:01edge loops sort of line up.
04:02But that would be a cool technique, if you wanted to, for example, have removable
04:06zippered clothing, where you could take parts off.
04:09That's just a simple example of how we can use the nConstraint weld adjacent
04:13borders to sew a garment shut.
Collapse this transcript
Creating a point-to-surface nConstraint
00:00Here's another way that you can constrain an nCloth object to another mesh in the scene,
00:06and it's called a point to Surface constraint. It's quite easy to use.
00:10What you will need to do is select some vertices on your nCloth object,
00:14and I will do that the same way I did before, by using Edge selection mode. I
00:19will go to Edge selection, and double-click to select that whole border. Then
00:23I want to deselect everything except for the area around his neck; I just want
00:26to constrain that area to his neck.
00:29I will hold down the Control key, and draw a big box around everything else to
00:33deselect all of those,
00:35and double check and make sure that I haven't accidentally forgotten anything, or
00:39missed anything. Just those in the very front.
00:43maybe not this one; I will deselect that with the Control key.
00:47This should be a vertex selection;
00:49I will hold down the Control key, and right-click on one of these edges and convert
00:55that selection To Vertices,
00:58and now I have got those vertices selected.
01:00Then I need to select the object to which I want this to be constrained. I will
01:04hold down Shift, and select the character mesh.
01:07And in the nConstraint menu, I want to choose a Point to Surface, and when
01:13I execute that, you'll see we have now these vertices indicating there's a constraint there.
01:19And I'll play the simulation, and you'll see now that that area is sort of stuck.
01:24Now, none of the rest of it is. You can see here that that rest of that is still
01:28free to move around.
01:29We can do another constraint here around his waist to keep his robe closed.
01:34I can go back into Vertex mode.
01:37Let's look at this in wireframe with the 4 key, and around his waist here I'll
01:42select that edge loop of vertices,
01:45and then Shift+Select the character mesh inside, and now I am ready to
01:51apply another constraint.
01:52nConstraint > Point to Surface.
01:56And you'll see here, as with all nMesh constraints, there are some springs there,
02:01and that indicates that we're trying to connect that point to the nearest
02:05point on the surface.
02:06And this is really cool, by the way, because you don't need to worry about where
02:10the vertices are on your constraining surface.
02:14In other words, I don't have to bother with making sure that there's an edge
02:18loop just there, or that I have got just the right number of vertices, or any of
02:24that; it just works.
02:25I press the 5 key, so we can see shading, and play the simulation. And those are
02:29actually constrained, and it actually is kind of stuck to his body now, but we
02:34can kind of improve that a little bit.
02:36First of all, the collision thickness is a bit thick for the robe.
02:41I have got it selected, and I have gone into the nClothShape node.
02:44Let's display, in the Solver Display, we'll show the Collision Thickness.
02:49And just as I suspected, it's pretty thick here, in this case.
02:52I am going to reduce that down to maybe about .5, or something like that, and now
02:57that will fit more snugly against his skin.
02:59Turn the Solver Display back off again, and now if I play my simulation,
03:05basically the same result.
03:07But now what we want to do is play around with the constraint attributes.
03:10I want to select that constraint, and if you have trouble selecting it in
03:14the viewport, you can use the outliner. Window > Outliner, and here's
03:18dynamicConstraint2.
03:21And then in it's attributes, you'll see in the Connection Density Range, below
03:26that section, keep going down until you see Rest Length Method, and Rest Length Scale.
03:35This is how long the spring wants to be.
03:38If I give it a lower value, then it will kind of pull the robe towards his body.
03:44I'm actually going to use a constant value, and I will set that rest length to,
03:49let's say, 1 centimeter, and play that back, and see what I get.
03:53It's pulled it in quite snug to his body.
03:56And that's how I really would want to do this.
03:59If I want to put a belt around this character's robe, I would model the belt
04:03separately, as a separate object,
04:05and it would not necessarily be an nCloth object.
04:09I wouldn't want to make the mistake of trying to make that belt functional. In
04:13other words, I wouldn't want to tie it off; that would be nearly impossible to do,
04:17and to make that dynamic.
04:19You would just fake it;
04:20you would create a belt that looks like it's actually holding the robe together,
04:26but then use a constraint to do the actual work.
04:29Maybe if you've got, you know, tassels on the belt or whatever, those could be dynamic.
04:34So that's the point of surface Constraint, and it works amazingly well.
04:39It's very easy to use.
Collapse this transcript
Creating a force field nConstraint
00:00Another really useful constraint is called a force field, and it's just basically
00:05a way that you can push nCloth around.
00:09I've created a situation here on purpose where my cloth is actually intersecting
00:14with the character, and when I play the simulation, his body is poking through the
00:19cloth. That's obviously not a desirable outcome.
00:22Now, I could fix that through thickness, and various other methods,
00:25but this is an illustration of how force field can save you when you have
00:29issues, such as, for example, elbows poking through cloth, and so on.
00:34Or even, just as a special effect, if you want to use the force field to push
00:38things around, you can do that too.
00:41To add a force field constraint, you can select your cloth object, or vertices on
00:46the object, and go up to that nConstraint menu, and choose Force Field.
00:51Now what happens is, any of the selected vertices are now constrained to that
00:56force field, and a small spherical manipulator is created in the middle of the selected mesh.
01:04And it's so small that we can't really see it here relative to our scene.
01:09Press the 4 key; there it is.
01:11So that's our force field. It's going to need to be a lot larger.
01:14I can reselect it, so I can get access to it's transforms in the Channel box.
01:21If you have trouble selecting that, then do it in the outliner; Window > Outliner,
01:26and in this case, it's dynamicConstraint2, and I've got a scale factor here.
01:31So I'm going to just turn that up to, let's say, 10, and now I've got a nice large force field.
01:37I'll rewind, press the 5 and 6 keys, so I can see what I'm doing, and then let's
01:43do this interactively, because that's more fun.
01:45I'll go up to nSolver > Interactive Playback, and move that force field, and oh my
01:51goodness; look at that! How cool is that? And I can, of course, animate this.
01:56It could be linked to other objects, like skeleton.
02:00In this case, all I really want to do is just push it up there enough so that we
02:04don't get any interpenetration with the character's skin.
02:08The force field is a really useful and versatile constraint that you can apply
02:12to many different situations.
Collapse this transcript
Dressing an animated character
00:00Now we come to the most exciting, and the most challenging aspect of nCloth:
00:05dressing an animated character.
00:08You'll find that nCloth is a very complex system, and because of that, and the
00:13many variables in nCloth, it won't work the first time you just drop an
00:17nCloth onto a character,
00:19and you will have to devote quite a lot of time to adjusting the many variables
00:24to prevent issues, such as interpenetration.
00:26I've spent a lot of time on this scene already, until I'm fairly confident
00:30that it's going to work.
00:32In your own scene, you'll need to set aside quite a lot of time
00:35for experimentation.
00:36What's the process here?
00:38Well, I've modeled the cloth in the character's bind pose, which is, of course,
00:44the character's pose in which it was modeled, and then bound to a skeleton, and
00:49traditionally, that's the T-pose, as we see here.
00:53And then I've animated the character out of that T-pose into the first pose of
00:58the actual animation.
01:00So here, he's simply just lowered his arms down to his sides.
01:04And I took a good healthy 100 of frames to do that, and during that time, the
01:09cloth will simulate, and settle down, so that it will match the character in the
01:13first pose of the animation.
01:16I could have modeled the cloth so that it was in the shape needed for the first
01:20pose of the animation, but that would have been more difficult, and probably
01:25caused more problems than it solves, in this case.
01:29My advice is, model the cloth in that neutral bind pose, and then animate from the
01:34bind pose to the first pose of the animation.
01:37And then from here, we've only got just a one second animation of him raising
01:41his arms. Very simple, and yet still will illustrate some of the challenges that we will see.
01:49I'll go ahead and select the robe object, and go up to the nMesh menu, and Create nCloth.
01:55The character's body is already a rigid collider, so you see we're getting
02:01pretty good simulation starting off.
02:04In order to keep the cloth on the character's body, we'll add a couple of
02:07constraints, just as we did earlier in the course.
02:10I'll go into Edge component mode; right-click, and choose Edge, and I want to
02:16grab the border here.
02:18I'll rewind, double-click, and now I've selected all those border edges. And if
02:24I try to unselect edges here with Control and drag, you'll notice that I'm not
02:30able to unselect those edges, and the reason is that the skeleton is currently visible.
02:35Maya always gives priority to selection of a skeleton, and that prevents us from
02:41selecting those edges.
02:43So I just want to go over into the layer editor here, and just hide the skeleton.
02:49Then hold down Control, and I can drag across to deselect those edges.
02:56Down at the bottom, as well, I'll need to do the same; Control and drag a rectangle
03:02to deselect some of these.
03:03I can go ahead and issue the command; in the nConstraint menu,
03:08I'll weld the adjacent borders.
03:10Check my work to make sure I don't have any constraints in undesired locations.
03:14Rewind, and play that back, and see if it's working.
03:18So that part is working.
03:19I'll repeat that process to add a constraint here up at the neckline.
03:24Right-click, and go into Edge component mode. Double-click to select all
03:29those edges. Hold down Control, and deselect everything except for the few edges
03:35around his neckline.
03:37This one I'll have to convert to a Vertex selection. I'll hold down Control,
03:41and right-click on that edge, and choose To Vertices, and now that's a vertex selection.
03:47I want to select the character; hold down Shift, and click on the character's
03:51skin, and we'll do nConstraint > Point to Surface, and when I execute that, you'll
03:57see we have these vertices indicating there is a constraint there.
04:01Rewind, and play the simulation, and it's holding onto his body pretty well.
04:07Now, let's let this play through and see what happens.
04:10We'll probably see some pretty severe issues here, because we haven't adjusted
04:14any of the nCloth properties.
04:17And pretty quickly, you'll see that, yeah, there are some serious issues, and
04:21as soon as he raises his arms up, we're probably going to see even more severe issues.
04:26So, as you can see, with just the default nCloth properties, it's a real disaster,
04:31but we'll fix that up.
04:33I'll rewind back to frame 1, select the cloth, and go to the Attribute Editor,
04:38Control+A, and I've already changed one thing in the nucleus node.
04:42Let's go into that nucleus solver node.
04:44I just set the Max Collision Iterations up to 10; I just increased it slightly.
04:50Back to the nClothShape node, I want to choose the silk preset. Click on Presets,
04:55and choose silk > Replace.
04:59Rewind, and play that back, and see how it's changed.
05:02Just changing that preset hasn't really helped much.
05:04In fact, in some ways, it's caused more problems, but we're going to
05:08resolve those issues.
05:10Rewind back to frame 1 once again, and I'll go up to the very top of the
05:14Attribute Editor, and possibly the most important attribute to change here, in
05:19this case, is the Self Collision Flag.
05:22These are different methods for calculating self-collisions, and the most
05:27accurate one is Full Surface.
05:29I'm going to choose that.
05:30I also want to change a couple of these attributes up here, such as the Thickness.
05:35I want to reduce that down.
05:37I'll set that to a value of 0.1, rewind, play back, and see if that's any better.
05:43The collision quality is going to be a little bit better, because we've chosen
05:47the Full Surface Flag,
05:49but we're still seeing some pretty severe issues here.
05:53What's happening is, because of the default Compression Resistance, these edges
05:59here are not allowed to become shorter, but they need to become shorter; we need
06:05the cloth to compress here in the area of the armpit.
06:09To achieve that, I'll go down into the Dynamic Properties, and I'll leave
06:14the Stretch Resistance at 60, but I want to reduce the Compression
06:18Resistance to nearly nothing: .05, and that will allow these edges to
06:24become shorter. Play that back,
06:28and you can see here in the armpit now, those edges are compressing, and that's
06:33going to give us a better result.
06:34It's probably not going to be quite good enough just yet. There are a couple
06:38other attributes we'll need to tweak.
06:40Let that play through, and see what happens.
06:43That's certainly better.
06:44We'll rewind back to frame 1, and adjust a couple other attributes.
06:49I want to scroll down a bit.
06:51The mass is only 0.2;
06:54I want to increase that a little bit. Let's set it to a value of 1. And scrolling
06:58down just a little bit further, in the Quality Settings here, we've got the Max
07:04Self Collide Iterations, and as the name indicates, that's the number of times
07:08the self collision algorithm is allowed to calculate, and to get better results,
07:14we'll want to increase that.
07:15I'm going to set the Max Self Collide Iterations to a value of 20.
07:20Rewind, and play the simulation.
07:24We've got good compression, and it looks like we are okay at this point.
07:29Let him go into that rest pose, and I've got about one second gap there between
07:36the settling down from the bind pose to the beginning of the animation; gave
07:41it a second, so that it would have some time to settle down.
07:45I think we're pretty good.
07:46I'll turn on the Smoothing here; press the 3 key, and that doesn't look so bad.
07:52Again, it's a time-consuming process. It's going to involve a lot of
07:56experimentation. Don't lose your motivation in this process. It's easy to
08:00get discouraged, because you'll play around with variables, and sometimes just
08:05make the problem worse.
08:06My advice is, change one attribute at a time, play the simulation, see what happens.
08:13If it didn't solve your problem, change that attribute back to where you found
08:17it, and try something else.
08:19If you change lots of attributes, and then play the simulation, then you will not
08:24be able to scientifically determine which attribute is causing the problem, or
08:29solving the problem.
Collapse this transcript
Simulating thick cloth with a wrap deformer
00:00As I mentioned earlier in the course, if you want to have thick cloth, then you
00:06can't really apply and nCloth directly to that thick object, and here's why.
00:13What I've got here is an example in which I've modeled a robe that has
00:19some internal volume.
00:21It's a solid watertight mesh.
00:24And I've applied an nCloth to it, just to demonstrate the issue.
00:27Go ahead and click Rewind, and play this back, and what you'll see is that the
00:32cloth immediately compresses, and becomes almost two-dimensional.
00:37Additionally, it's self-intersected here. If I select it, we might be able to
00:42see that a little bit more clearly.
00:43It's actually pushed through itself, and that's clearly not a desirable outcome.
00:48Additionally, if I rewind, and play it back again, you can see that I'm only
00:53getting about maybe 4 frames a second, or 5 frames a second,
00:57and we can do a lot better than that.
01:00Really, what we want is an infinitely thin cloth that's going to calculate the
01:05dynamic simulation, and then we want that to then drive the thick cloth, which
01:10we'll actually render.
01:11And we'll use a wrap deformer to do that.
01:14I've got another scene.
01:15I'll go ahead and open.
01:17It's thickCloth_2_begin; open that up, and rewind, and play it.
01:24And you can see that's my cloth simulation, and I've got about 18 to 20 frames a
01:28second on that. Definitely a big improvement,
01:31simply because this is two-dimensional, and it's got fewer than half the number
01:36of vertices than that thick cloth had.
01:40On my layers here, I've got a robeThickLayer, and I can make that visible.
01:46You can see that this is just the same one we saw before.
01:50I want to open up my Outliner, and you'll see I've got robeThin, and robeThick.
01:54We're going to add a wrap deformer to this.
01:57What you want to do is select the deformee first, and that is, in this case, the thick cloth.
02:03And then select the deformer; the thing that's going to be driving this
02:07deformation. Select that second, so I'll Control+Click on robeThin.
02:10I want to go to the Animation menu set, and under Create Deformers > Wrap.
02:19Let's rewind the simulation, and play it back, and you can see that we're getting
02:24something; it is actually deforming.
02:27But if you look really closely, it's not doing a terribly good job.
02:31Here's the thick cloth, and it doesn't seem to be really properly bound to the
02:35thin cloth, which is here, and they're not matching.
02:40And the reason for this is the wrap deformer, by default, acts kind of like smooth
02:44skin binding, where a single vertex on the deformee is bound to more than one
02:52vertex on the deformer here.
02:54What we need here is similar to rigid skin binding, where there is more of a
03:00one to one relationship between the deformer and the deformee.
03:03To accomplish that, I want to go into the wrap deformer,
03:11and the attribute that we want to play with here is Exclusive Bind, and it's off
03:16by default, and that means act like a smooth skin binding.
03:21We want that to be on. Type in a 1, press Enter, and now it will act like a rigid skin bind.
03:27Rewind that, and play it back. There we go; much better.
03:31And of course, I can hide my simulation layer. Dolly out a little bit, and see
03:38what we get. Rewind, play that back,
03:42and with that wrap deformer added now, we're getting about 12 frames per second.
03:46That's certainly a lot better than the 4 to 5 frames per second we were
03:50seeing with the non-wrapped deformer version that we saw at first.
03:55And additionally, when we play this back, the thickness of the cloth is preserved
04:00throughout, and we don't see that compression.
04:03So that's one of the tricks of the trade; how to get fast performance for thick
04:08cloth that doesn't self-intersect, using a wrap dseformer.
Collapse this transcript
Painting attributes by vertex
00:00One really common that you'll need to do in nCloth is assigning dynamic or
00:06collision properties to certain areas of the cloth.
00:10For example, I've got a scarf that's going to land on this character's neck,
00:15and what I need to have happen in this shot is I want the scarf to blow in the
00:20wind, but it needs to stay on the character's neck.
00:24I could assign stickiness to the entire scarf, but if I did that, then it
00:28wouldn't be allowed to blow in the wind.
00:30What would happen is, as soon as it touches any other dynamic object,
00:34it would just stick there, and stay there.
00:36What I want is to have stickiness around here in the back of his neck, and no
00:40stickiness everywhere else.
00:42And I can achieve that using painting dynamic attributes per vertex.
00:47I'm going to open up the Attribute Editor; with that cloth object selected, I'll
00:52hit Control+A. I just want to point out, in the nucleus solver node, that I have
00:58changed the Time Attributes, Start Frame to frame 100.
01:02That means that the simulation will begin on frame 100.
01:05And also, you'll notice that my start range for the animation range is also 100,
01:12and I've done that just so that there would a run up to allow the robe to settle
01:16down on the character's body.
01:18And additionally, I've set an initial state for the robe, so we don't want to remove that,
01:23so we will leave that as is.
01:25Well, I've paused my playback, and I'm on about frame 125, and I want to add some wind.
01:31I'll give it a Wind Speed of 100, and I want the Wind Direction to be from behind
01:36the character; that's going to be positive Z.
01:39The Wind Direction X, I'll set to 0, and Wind Direction Z, I'll set to 1,
01:45and resume playback.
01:46What I expect to see here is that, indeed, the scarf will blow in the wind.
01:50It will actually blow just right off the character, and just blow away.
01:54That's because there is no stickiness to the scarf currently.
01:56I'm going to rewind, and we're going to paint the stickiness attribute.
02:03Just select the object, and go into the nMesh menu, and you'll see Paint Vertex Properties.
02:10And you can paint any, or all of these.
02:12What I want is to paint the Stickiness now.
02:15And I want to go into the Options open up the tool options.
02:19And the first time you do it, what you'll see is your object turns completely white,
02:23and that means that the current attribute that we're painting into -- stickiness --
02:27has got just the default value of 100%, or a value of 1.
02:32And that's a multiplier, that multiplies with the per object attribute, as we'll see.
02:38What we want to do now is we'll go ahead and paint into these areas here,
02:44where we do not want any stickiness.
02:47I want to set the value down to 0, and I can change the size of my brush, just
02:52like with all the artisan tools.
02:54I can hold down the B key, and reduce the size of the brush, and just paint.
02:59And I'm painting a value of 0, or Black, in these areas that I do not want to be sticky.
03:05Just take a moment to do that. Same thing here; no stickiness. We just want it to
03:11stick just only around his neck line.
03:15Okay, so that was easy.
03:17Now I need to go back into the Attribute Editor, Control+A, and I had to have some
03:22value to the Stickiness here for this to work. Set that to 1.
03:27And if we look, actually, down in here, you'll Collision Properties Maps, and if I
03:31open that up, you'll see this Stickiness Map Type is set to Per-Vertex.
03:35That happened as soon as I opened up that menu item to get the tool settings here.
03:40I could've also selected the option here, and then opened the tool settings.
03:45I'll rewind, play that back, and see what I get.
03:51There we go; much better.
03:52We've got a lot of wind, but the scarf is staying stuck to the character's body, and to the robe.
03:59That is exactly the result that we're trying to get.
04:01That's all there is to it, and you could paint any of those attributes using
04:05that same technique.
Collapse this transcript
Painting attributes by texture
00:00In addition to painting attributes by vertex, you can also use textures to
00:05accomplish the same thing.
00:07We could use the command within here that says Paint Texture Properties, and
00:13paint the Stickiness. That would give us basically the same functionality as
00:17painting by vertex, except we would be creating an actual file texture
00:22through the 3D Paint tool.
00:23What I am going to show you instead of that is something a little bit more
00:27interesting, I think, which is using a ramp that we can just procedurally assign
00:33the stickiness based upon the UVs on the scarf here.
00:38So I have got it selected, and in my nucleus, you'll see Wind Speed of a 100, and
00:44Wind Direction of 1 in Z. And when I play it, we can expect that it's just
00:50going to fly right off the character's body, because of the wind, and because
00:54there's no stickiness.
00:56In order to see what I'm doing, I want to assign a material. I just want to
01:00right-click, and choose Assign New Material. This way I can see the ramp that I am working on.
01:06And I want to assign just a standard Lambert.
01:08I am going to give it a name; I'll call it stickinessLambert, press Return, and
01:15for the Color here, I want to a ramp. I'll click on Add Render Node, and I want a rampTexture.
01:23And if you have hit the 6 key in the Viewport, then you can see that ramp; 5, and 6.
01:28This is just going to be black and white. Delete one of those little flags
01:34there. Change that color white. This other one here, we'll change to black.
01:41And you'll see that the texture is wrapping around in this direction.
01:46So I go up here; it says V Ramp. I what U Ramp, in this case. There we go.
01:52Now the texture is wrapping around the direction I want. And I'll just set this
01:56up so that we'll have white here behind the back of his head. Make another black
02:02flag by just clicking here in this black area, and reposition these.
02:08And if I did that this way, then we would have a gradual transition between a
02:12very sticky, and a very non-sticky area, but I want a more sudden transition.
02:19And if I want to be really particular about it, I could set these to exact values,
02:22like that could be .5 for that white one, and this could be maybe .6, and this one
02:28perhaps .4. And now we have just got the stickiness only in that one area. Maybe I
02:35will extend that just a little bit. Let's give this .65, and give this one .35;
02:41give it a little bit more stickiness there.
02:46That's just the texture. I've set up the ramp.
02:49Now what I want to do is assign this ramp that I've created to the stickiness
02:53attribute. Select that scarf, go to shape node, and open up the Collision
03:00Properties Maps, and you will see Stickiness Map Type is already set to texture;
03:05that's the default, in fact, and if there is no texture here in this slot, then
03:09there will be no effect.
03:11I want to take the texture that I created, and place it in the slot.
03:14I don't want to click to Add Render Node, because that would create a new
03:19render node. I want to use the one I already have.
03:22To do that, I'll open up the HyperShade. Window > Rendering Editors > HyperShade. I'll go to
03:29the Textures tab, and here's the ramp that I made, and I'll just hold down the
03:34middle mouse button, and drag that over here onto the stickiness map.
03:38Now here's the thing: you can't drag it onto the field itself. You need to drag
03:43and drop it onto the name, until you see that dashed line around everything there,
03:49and then release the mouse. My ramp is assigned.
03:51It won't do anything
03:53if I have 0 Stickiness up here, so I'll need to set the global Stickiness value
03:57to 1, because that ramp color is acting as a multiplier, and multiplying by 0 gives you nothing.
04:05Let's test that; see what we get. Rewind, play it back; we got lots of wind,
04:12and once again, just as with painting by vertex, the scarf is sticking to
04:17the character's body just around his neck, and the area that has no
04:21stickiness is blowing freely.
04:23Of course, I would want to reassign a different material to this. I can just
04:28reassign back to Lambert 1.
04:31The material that I created at first, which was called stickinessLambert, was just
04:35only there for visual purposes, so I could see where the stickiness ramp was
04:40landing on the surface of the scarf.
04:42This is a versatile technique, and of course, we could apply that to any one of
04:47these collision properties, or the dynamic properties maps here as well.
Collapse this transcript
Animating nConstraint attributes
00:00Nearly anything in Maya can be animated, and nucleus constraints are no exception.
00:06One common thing that we might want to do is enable or disable an nConstraint
00:11over time in order to connect or disconnect the cloth to some other object.
00:16That's what we'll do here.
00:17I've got two constraints.
00:19I've got a point to surface constraint around the neckline, and I've got a weld
00:22adjacent borders constraint down the center of the robe.
00:25I'm going to open the Outliner; Window > Outliner, and you'll see I've got two
00:30dynamic constraints here.
00:31I'm going to select both of those, and I want to key the Enable attribute.
00:36You'll see it here: Enable,
00:39and right now it's on. I want to key it on. Rewind back to frame 1, select the
00:45name, and then right-click, and Key Selected.
00:48Now I've got a keyframe there
00:50on frame 100, which is the beginning of my simulation.
00:54I'll let that play through for a second, until it settles down, and then around
00:59frame 130, or something like that, I'll turn it off.
01:03Set that to 0 to turn it off, and you'll notice that the icons for the
01:08constraint have disappeared. Press Enter, then select the name, right-click, and
01:14choose Key Selected.
01:16Now I've got a second keyframe here at frame 136.
01:20Rewind, and play back, and as soon as we hit frame 136, the constraints are disabled,
01:26and the robe is allowed to fall off the character's body.
01:29Pretty simple technique, but very useful. We could reverse that process as well.
01:34We could set up a simulation in which some piece of cloth needed to land at
01:39a certain location, and stick there permanently. We could use constraints to
01:43achieve that.
Collapse this transcript
Working with nCaches
00:00One of the coolest features of Nucleus is the ability to save out multiple
00:05caches per object. That means that we can save variations on the same
00:11animation, we can swap those out, we can blend them, we can even animate
00:15the blending, we can even go in and paint certain areas to use one cache, and
00:22other areas to use another cache.
00:24In this scene, what I have got is a character who's just draped with a scarf, and
00:29when I press Play, you'll see that the scarf is just going to settle down for a
00:34second. It takes about one second to come out of its initial state. You'll see
00:38that a lot with nCloth is, even though you set an initial state, you'll still need
00:42to have about one second run up while that cloth settles.
00:47But after that one second run up, then it should be more or less static, because
00:50there are no forces acting upon it; there's no wind, and there's no animation on the figure.
00:56So we're going to create our first cache with no wind. I'll select that scarf,
01:01and go up to the nCache menu, and choose Create New Cache.
01:04I want to go into the Options here, and I want to actually give this a name.
01:09nClothShape2, which is the name of the cloth shape node, _noWind. That way I'll be
01:17able to know which is which later.
01:19Go ahead and click Create, and that will take a couple of minutes to calculate.
01:26Now that first cache with no wind has been calculated, and I can scrub through the
01:29timeline to observe the results.
01:32You'll see that there is a little bit of movement there, and that's actually
01:35because of the simulation properties on that nCloth.
01:40If I had time, I would sort that out, and make that better.
01:43But for the moment, we're really just interested in adding multiple caches.
01:48Now I want to add wind. Reselect that scarf, and hit Control+A to open up
01:53the Attribute Editor,
01:55and go to the nucleus node, and I want to find Gravity and Wind, Wind Speed, and Direction.
02:01I'm going to set the Wind Speed to 100, and the Wind Direction is already set
02:05to positive Z, which means it's going to be blowing from behind the character.
02:10Now, if I press Play here, we won't see any change, because, of course, that
02:14cache is still in effect.
02:16We can disable the cache. We can go into nCache > Disable All Caches On Selected.
02:23And then when we rewind, and play back, we will see the effect of lots of wind.
02:28This version of the scene file has a stickiness vertex property here, just as
02:34we did earlier, in an earlier movie, so that this area here is sticky, and the rest
02:40of the scarf is not.
02:41That's plenty windy; I think we're good.
02:44We're going to build another cache now, with new simulation properties. With the
02:49scarf selected, go back up to nCache > Create New Cache, and go into the Option box,
02:56and we need to just give this a unique name: nClothShape2_Wind, and click Create.
03:03And we get a dialog asking us, do we want to add and blend, or replace
03:08the existing cache?
03:09Well, of course, I don't want to replace the existing cache. I want to click Add and Blend.
03:14It won't actually blend right away, because we disabled the other cache.
03:18What this is going to do is actually just add a new cache, and we can play
03:23with blending later.
03:24Go ahead and let that simulate, and once again, that'll take a couple minutes.
03:31That second cache has finished simulating, and it's stored to disk, and I can
03:35scrub through the timeline, and check the results, and make sure that it's more
03:38or less what I want.
03:40And I think I'm happy with that. Now let's look at combining the two caches,
03:46or choosing one of the other of them.
03:49Whenever you add a new cache, and you get the dialogue, and you click on Add and
03:53Blend, what it does is it creates a cache blending node, and we don't have
03:58access to that blending node through the menus here. It's only found in the Attribute editor.
04:03You'll want to select your cloth, hit Control+A to open the Attributes,
04:07and then select one of the tabs here; we're looking for something called
04:11cacheBlend. There it is; cashBlend1.
04:15And you can see here ClothShape2_noWind, and ClothShape2_Wind, and they both
04:21currently have a value of 1.
04:22And as I scrub through here, we're not actually seeing any blending.
04:26Well, we can go back up to nCache > Enable All Caches,
04:31and once we've done that, we actually have a blend between the two, because they
04:37both currently have a value of 1.0.
04:40To choose between one or the other, we'll just set these values.
04:44If I want a windy version, I'll set noWind to 0, press Enter, and that's my fully
04:51windy version. Or if I want no wind, I can set this to 1, and set this one to 0,
04:58scrub through, and I have got the no wind version.
05:02If they're both set up to 1, we'll get a half and half between those two.
05:07And we can animate these as well.
05:10We can change these values over time, so that we'll have a transition between
05:14two different caches.
05:15Let's say I want, on frame 100 here, to have no wind. Go ahead and turn my wind
05:22cache down, and I want to key both of these.
05:25I'll right-click, and say Set Key, and right- click on the name up here, and choose Set Key.
05:31Scrub through, and I want to figure out when I want that to start blowing;
05:35maybe around frame 140.
05:38And I want to key these again, just to make sure that those values are maintained
05:42between frame 100, and frame 140.
05:44I'll right-click, and Set Key, and again, right-click, and Set Key.
05:49And I want some amount of transition time; maybe a 1 second transition. I'll bring
05:54this forward to, let's say, frame 164, or something like that,
05:58and then just swap these values out.
06:00Set the noWindCache value to 0, set the WindCache value to 1, and then key them
06:06both. Right-click, and key selected; right-click, and Set Key.
06:11And now when we scrub through here, you'll see that we have no wind up until
06:16frame 140, and then it gradually transitions up.
06:20We could go into the Graph Editor, and change the transition, but at this
06:25point, I think we're good. We've got a good example of how to play with
06:29caches for Nucleus.
Collapse this transcript
Painting cache weights
00:00To finish our chapter on integration with animation, we'll look at painting cache
00:06weights. This is a really interesting idea.
00:09We can have more than one cache per object, and we can paint where we want a
00:14particular cache to have effect.
00:17In this scene, I've got a scarf that's got two caches on it already. Just
00:22carried that over from the previous exercise. There's a cache that has wind, and
00:26a cache that has no wind.
00:27If I select it, and go to the Attribute Editor, Control+A, we can look through these
00:33tabs here, and here it is: cacheBlend1.
00:36And you'll see they're both up at full strength, with no keyframes on them. And I
00:40know that, of course, because these fields are in white, indicating there is no
00:44incoming connection.
00:45Now we want to open up this tool in the nCache menu, Paint Cache Weights Tool,
00:53and we need to go into the Option box to get those tool options up.
00:58So we've got our caches listed up here. We've got WindCache1, and noWindCache1.
01:04Currently, they both have full influence, and I know that because they're both
01:08showing as fully white. I'm going to hide everything, except for that cloth. I
01:13am going to hide the skeleton, and geometry, so we can just focus in on this, and paint on it.
01:18What I want is I want one side of the scarf to be blown by the wind, and the
01:22other side not blown by the wind,
01:25and I can do that by painting a grayscale value.
01:29We've got a Value slider here. The default is actually 1; I am going to turn that
01:33down all the way to 0,
01:35and I'm going to paint in order to determine which areas will be affected by which cache.
01:40As I hover my mouse across the surface, you'll see I have got a nice big brush.
01:45If you need to change the size of the brush, hold down the B key, and drag your
01:50mouse cursor from left to right to change the size of the brush.
01:54I want the left side of this scarf to be not windy. I'll go ahead and select
01:58noWindCache, and I'm going to actually paint black on this side. That means this side
02:05will not be affected by noWindCache.
02:08Let's paint that whole thing.
02:12And since it's two-dimensional, I probably don't you worry too much about
02:16the back side, but here you go, look, it's folded in on itself, so I better paint that backside.
02:21Just take a moment to do that.
02:24And I want the area around the neck slightly selected;
02:27I want that to be effected by no wind.
02:31Set the noWindCache value to 1.
02:34So that area that's in black now will not be affected by the noWindCache.
02:42Now go to the WindCache, and once again, paint with black, and I'll just paint the
02:47inverse; this is the area that will not be affected by the WindCache.
02:54Same thing here, make sure I get everything on the back sides,
02:59and I am painting a value of 0, or black.
03:03Tumble around in the view. Let's paint that whole thing,
03:08and this area up here, I don't want that to be affected by the wind either.
03:12And now we want to check these. I can just switch these two, and what I want to
03:16see is basically a negative image.
03:19And there's a little bit of an overlap there, so I'll just fix that up.
03:22Let's say I want this one to be a little bit windier,
03:26so I'll paint some black here on that noWindCache. There we go.
03:34I'll deselect the tool. I'll turn my Geometry back on, and the Skeleton.
03:40Rewind, and play that back, and there you go. We've got wind on one side, and no
03:46wind on the other side.
03:48We could do this with as many caches as we want, but two caches here are sufficient
03:52to illustrate the process.
Collapse this transcript
6. Simulating Special Effects
Simulating many objects
00:00nCloth is not just for cloth. You can do all kinds of interesting special
00:04effects, such as this one with leaves blowing off of the tree.
00:08So let's dive into it.
00:11Here's a Maya scene that has a single Paint Effects tree in it.
00:15I'll play that back for you,
00:17and you'll see it's got some turbulence on it, so that it appears that it's
00:20blowing in the wind,
00:21but the leaves are not able to fall.
00:24If you want to learn how to build Paint Effects trees, and other forms of Paint
00:28Effects then you can look at some of our other titles on lynda.com.
00:32Specifically, I have got a title called Maya 2011:
00:35Creating Natural Environments, and it goes into customizing Paint Effects
00:39in pretty good detail.
00:40But we need this to be a polygon object in order to turn it into nCloth.
00:45I'll go ahead and select it, and go up to the Modify menu, and choose Convert, and
00:50we're looking for Paint Effects to Polygons.
00:53And now it's been converted into polygons.
00:57Now we're ready to convert the leaves into nCloth.
00:59I'll select the leaves, and see that that's a separate object now, and we can go
01:05into the nDynamics menu set, to nMesh > Create nCloth, and rewind, and play the simulation.
01:13And you'll see that the leaves are no longer are connected to the branches, and
01:16additionally, they're falling, but falling super slow.
01:20By now, if you've seen the rest of the course, then you know what the problem is
01:24here, which is that there's a mismatch between the nucleus scale, and our object scale.
01:31We want to select the nCloth, hit Control+A to go to the Attribute Editor, and we
01:37want to find that nucleus node,
01:39and we want to find Scale Attributes. Set the Space Scale down to .01, because my
01:45scene is built at 1 to 1 scale.
01:48Additionally, while I'm here, I am going to reduce the Max Collision Iterations
01:52down to maybe just a value of 1. That will just speed up calculations a little
01:57bit. We're not really too concerned about collisions in this particular case.
02:02And scrolling up a bit too, I just want to turn the Ground Plane on,
02:05and also give it some wind; I'll give it a Wind Speed of a 100.
02:10And it's blowing in positive X, which is fine.
02:13I rewind, and play that back. Wow!
02:17That's really neat.
02:18So let's play around with this a little bit.
02:21First of all, we could give this a little bit of friction, or stickiness, so
02:24that when the leaves fall, and land on that invisible ground plane, they'll
02:27actually stay there.
02:28I'll go to the shape node, and it's got a Thickness of 10; that's a bit much, so
02:34I'll give it a Thickness of, let say, 1.
02:36Scroll down a bit, and you'll see we had Friction, and Stickiness.
02:41Let's give it a Stickiness of, let's say, .5. Rewind, and play that back, and see what happens.
02:47So when they land, they kind of just drift a little bit. Maybe I'll increase the
02:51stickiness just a bit; we'll give that a stickiness of 1, and try again.
02:59That's pretty cool.
03:00They seem to be falling pretty fast. I'll rewind, and scroll down, and just
03:05reduce the Mass a bit.
03:07In the Dynamic Properties, it's just got a Mass of 1.
03:11Let's give that a Mass of .3.
03:14They should stay aloft a little bit longer because of that.
03:17Later we'll go back, and we'll play around with these other attributes, and try
03:21to make that better.
03:22But for now, we're more concerned about getting them stuck to the tree, so that
03:25they will fall off not all in one go.
03:29And to do that, we'll add a dynamic constraint. Select the leaves, Shift+Select
03:35the branches, go up to nConstraint,
03:37and this time we want a Component to Component constraint.
03:41Go ahead and execute that,
03:43and as soon as you do that, you'll see that you have lots and lots of links. We
03:47need to dial that down a bit.
03:49We'll also play it, and see what we get. They're all stuck to the tree once again.
03:54You'll notice now that my frame rate has gone down to about half of what it was
03:58a minute ago, because there's so many constraint links here.
04:02So let's fix that up.
04:03I'll go to the dynamicConstraintShape node, and I'm looking up near the top for
04:09the Connection Method, and it says Nearest Pairs.
04:12What that means is, it's trying to find the nearest vertices to the constraint
04:19object, but that's not really working here. We're going to go ahead and chose
04:24Within Max Distance; that's obviously a distance-based destination.
04:28If I rewind, and play that back now with a max distance of .1, they're not
04:34constraint any more. You'll see we got a major performance hit too.
04:40Rewind, and let's set that Max Distance to, let's say, 50 centimeters. Press Enter,
04:45and now you'll see we have links in the right places.
04:47And we play that back, and that's actually helped the performance.
04:52They're not falling off, because they're kind of stuck on there permanently.
04:55What we want to do is reduce the Glue Strength. Scroll down here a little bit.
05:01You've got the ordinary Strength here, which is the overall strength for the
05:05constraint, and then there's Glue Strength.
05:07We can give that a little bit lower value, which will cause the wind to actually
05:11blow those leaves off the branches.
05:13Give it a Glue Strength of, let's say, 0.9.
05:18Rewind, and play that back,
05:20and we're almost there. You'll see that they're falling, but they're falling all
05:24at once, once again.
05:26The last thing we need to do to make this work is to select the branches, and
05:31when we created the constraint, Maya converted this to an nRigid object, so
05:38that's now passive collider, but Collisions are disabled.
05:43So I just want to turn that on. Enable collide for the nRigidShape node of the branches.
05:49Rewind, and play that back, and it'll blow around for a few seconds, and then
05:55slowly those leaves will start to drift, and land.
06:00And that doesn't look so bad.
06:02If we don't like this display, if this is kind of bugging us with all these
06:06little points on here, we can just select the constraint node, go in here, and
06:11just disable the display. Here we go; Display Connections.
06:16So I could playblast this now, and it wouldn't look so ugly.
06:21So in just a few mouse clicks, really, we've got leaves blowing off of the tree.
06:25Can you imagine how difficult that would be if you wanted to animate each leaf separately?
06:31That would take ages. It would take eons to do this by hand.
06:35But with nCloth, it's a breeze. It takes just a few seconds, really, as long as you
06:40know what buttons to press, and now you do.
Collapse this transcript
Adjusting lift and drag
00:00We'll now dig a little bit deeper into the nClothShape node to adjust the Lift
00:04and Drag on the leaves, to make them move the way that we want.
00:09To do that effectively, we really need to be able to see real time playback in the viewports.
00:14As I was developing the scene files for this course, I discovered what appears
00:18to be a bug in this version of Maya, in which even if I disabled the constraint,
00:24and the rigid node, and collisions, I wasn't getting any performance benefit from doing that.
00:30I need the leaves to move in real time, and the only solution I was able to find
00:35was to in fact delete the rigid and dynamic constraint shape nodes.
00:39So we're going to have to do that as a workaround. We'll delete those, and then
00:44the leaves will fall in real time. We can figure out what values we want for
00:48the Lift, and Drag, and then write them down, reopen the scene, and reapply those values.
00:55So I'm deleting the nRigid shape, and dynamicConstraintShape. I've selected those in
01:01the Outliner, and press the Delete key on the keyboard.
01:06Rewind, and play back, and it's very, very important that I see those move in real time,
01:10so I am just checking that I'm not seeing that bug happened anymore.
01:14So now we can start playing around with the attributes.
01:18I want to select those leaves, and I want to go back to the nucleus node, and
01:24increase the wind a bit. I am going to crank that wind up. I have only got at a
01:28100 now; I am going to cranked that up to 1000.
01:31And additionally, I had reduced the Max Collision Iterations down to 1. I'm going
01:35to bring that up to 4, and rewind, and play that back.
01:40You'll see the wind is blowing those leaves away a lot more strongly now. Play that back.
01:45Wow!
01:47That's really neat.
01:49Now, Lift and Drag are going to be found in the shape node.
01:51I'll go into that nClothShape node, and scroll down, and we've got, near Mass,
01:58we've got Lift, and Drag.
02:00These are supersensitive attributes.
02:03If I turn them down to 0, we'll see a bit of a change here. Rewind, and play that back.
02:08And you'll see that interestingly, now with Lift and Drag set to 0, the wind
02:14is having no effect.
02:16The Drag attribute controls how much the wind will affect the leaves.
02:21If I set Drag to, let's say, .001, that's going to produce some air resistance on those leaves,
02:29but not much. Let's try .05.
02:31There we go, so that's the default value 0.05.
02:38If I wanted them to move less under the influence of the wind, obviously, I can
02:43reduce this Drag amount, say, .01.
02:47So, Drag is the air resistance.
02:50Lift is the tendency of the leaves to remain aloft; to actually stay in the air,
02:57and if I reduce the wind down to 0 in the nucleus node, and play it back with no
03:06Lift, and no Drag, and no wind, then the leaves just fall straight to the ground.
03:10And I'll give it a little bit of Lift; let's try the default of 0.5, rewind, and play back,
03:17and you'll see that they actually kind of scatter around.
03:21And they're moving according to their own shape.
03:23Each one of these is a tiny little piece of cloth that can actually bend.
03:27And I haven't tried playing around with the rigidity, or the bend resistance of
03:32the cloth, and so they're kind of free to flutter around.
03:36I think what I want here is a lower value to the Lift, like a .001.
03:40And now they scatter. That's a lot more elegant, I think.
03:47Again, these values are incredibly sensitive.
03:50Let's try a Drag of .02, and a Lift of .001, and then re-enable the wind.
04:03Let's try wind of a 100.
04:05I'll rewind, and play that back.
04:09So you see with a low Drag, and low wind, we don't get much.
04:15But if I either increase the wind, or increase the Drag, it'll cause the leaves to
04:20blow over to the side more.
04:21How about a drag of 0.1?
04:25Play that back, and see what we get.
04:27And they're getting pushed over a little bit more to the right.
04:30I am just going to crank up the Wind Speed. We'll just fine-tune this; maybe 500.
04:36Rewind, and play back, and I think that's a naturalistic look, with leaves
04:42scattering in the wind.
04:44Now, because of the bug that I mentioned earlier, where I wasn't getting
04:47real-time playback, I need to write down these values, and then plug them into
04:51the scene. I have got a Wind Speed of 500, and in my shape node, I've got a Lift
04:58of .001, and a Drag of 0.1.
05:02So I have written those down. I'm going to reopen my scene.
05:07I have got Recent Files; I can just reopen that same scene, and of course, I
05:11don't want to save.
05:13And now that I know what values I want, I can go ahead and plug those in.
05:18Select the leaves. I have got a Lift of .001, a Drag of .1, and a Wind Speed of 500.
05:29Additionally, I'd also increased the Max Collision Iterations a bit to, let's say, 4.
05:35And now we're going to be back to a slow playback here.
05:39We'll need to playblast this in order to see the end result, otherwise
05:43it'll just take too long.
05:44Select the Constraint node, go in here, and just disable the display.
05:50And we'll do Window > Playblast, and let's go into the Options for that playblast.
05:55Save it out, click Playblast, and allow it to play through.
06:01This has just rendered a temporary movie.
06:06My playblast is finished calculating. Let's see what we get when I press Play.
06:11You can see that those leaves are drifting over more towards the right, and that
06:15feels a bit more natural than what we had at first.
06:18I think my tree has got too much turbulence on it, but we can't blame nCloth for
06:23that. That's the settings I had in the Paint Effects brush.
06:26So that's how we can adjust Lift, and Drag.
Collapse this transcript
Applying wind shadow
00:00Here's another really cool feature of Nucleus: we have the ability to block the
00:05wind coming from the nucleus node.
00:08What I've done here is I've got my flag with some wind on it, and I've built just
00:12a simple plane to act as a barrier, to illustrate how the wind shadow works.
00:18Currently, we're not seeing any wind shadowing. The flag is blowing in the wind.
00:22I'll select my object that I want to block the wind.
00:25Let me go ahead and make that into a passive collider. So that's the precondition;
00:31it's got to be a passive collider.
00:33It could also be an nCloth, but that would be overkill.
00:37Rewind, and play that back, and it's currently not blocking the wind at all.
00:41I'll go ahead and select it, hit Control+A to open up the Attribute Editor,
00:46and in the nRigidShape node, you'll see a section that says the Wind Field
00:50Generation, and we need to increase this attribute: Wind Shadow Distance.
00:56What that means is, what's the area around the object in which the wind will be blocked?
01:02And with the value of 0, then it's not blocking at all.
01:05If I gave it a low value of 1, for example, then it would only affect nCloth
01:11objects that were 1 unit away,
01:14and if we play this again, we will not see any change.
01:18In this case, because I've got a world that's built at 1 to 1 scale, this
01:22will have to be a really high value, like a value of, let's say, 500. Rewind, and
01:28play that back, and you'll see now the wind is being blocked by that plain.
01:32Well that's pretty cool, but it gets better, because we can animate this, as long
01:38as this object moves around, it can actually block the wind, or not.
01:43And we can see that really obviously if we just go into interactive playback mode.
01:47I have got my plane selected, I have got the Move tool active, go to
01:52nSolver > Interactive Playback, and I've got 6000 frames in my timeline.
01:58There it is, with the wind enabled, and then if I simply move this out of the way,
02:03the wind will kick in again. That's pretty neat.
02:05Now I put it back, and it blocks the wind.
02:10Now, of course, if it were on the other side of the object over here, then it
02:15wouldn't be able to block the wind, because the wind is actually blowing in
02:19positive X. Just like in the real world, that's not going to block the wind. And
02:23of course, we'd animate that as well. It doesn't have to be interactive playback;
02:27we could animate this position either up and down, or forward and back. Any way to
02:31get that farther away from the nCloth object.
Collapse this transcript
Connecting nCloth to fields
00:00Maya fields are forces that can operate on dynamic objects, including nCloth, but
00:06also including particles, and rigid and soft bodies, as well as Maya fluids.
00:12What we are going to do here is we are just going to make these leaves fly off
00:17the tree as if they are kind of exploding outward.
00:19If I press Play, you'll see that there's nothing fancy going on with those leaves
00:23there; just nCloth objects that have basic properties. There's no wind or
00:28anything in the scene currently.
00:30I'll select those leaves, and go up into the Fields menu, and choose Radial.
00:36A radial field will push or pull dynamic objects in all directions: towards, or
00:43away from the field location.
00:46I'll move that field upward, so that it's this kind of near the center of the tree.
00:51If I play my simulation, I won't see any change just yet, because the field options
00:56need to be adjusted. With that field currently selected, you'll see I have got
01:00the attributes open here in the Channel box.
01:03The main one I need to do here is I need to turn off Use Max Distance. That means
01:08that it's only able to affect objects that are as far away as the Max Distance
01:13value, which is currently only 20 centimeters.
01:15I want to turn Max Distance off; set that to 0. Rewind, play back, and you'll see
01:22that those leaves are flying outward.
01:23There is also an Attenuation factor here; that's really not going to affect it
01:28that much, but I'll turn it off, just because I can.
01:31Attenuation is the influence of the field up to the Max Distance.
01:36If Attenuation is 1, then the field will have full effect at the location of the
01:41Field icon, and it will drop off linearly as it reaches the Max Distance value.
01:47But with Attenuation turned off, and Max Distance set to 0, the field will affect
01:53all of the leaves equally. Play that back.
01:56Now, you'll notice that the leaves are currently accelerating away from the tree,
02:02and that's because the leaves have inertia, and what's happening is that the
02:07radialField is being applied on every frame of the animation, and that's adding
02:12to the existing momentum that's carried over from the previous frame, and the
02:16end result is that the objects accelerate; with each frame, they pick up more and more speed.
02:21All we need to do to correct that is to keyframe the Magnitude, so that it will
02:27just kind of kick the leaves outward, and then shut off.
02:30I'll rewind to frame 1, and Magnitude is currently 5.
02:35I don't know what it will need to be once I keyframe these values,
02:38so I'll probably have to go into the Graph Editor and fix it, and it will
02:42probably need to be a greater magnitude,
02:44but I'll use this as a starting value. I'll right-click, and choose Key Selected,
02:47and then on frame 1, I have got a keyframe with a magnitude of 5. Play that back.
02:53And then I want to go 2 frames later. If you only keyframe the field on for one
02:59frame, then really, nothing will happen.
03:01I'll just go forward two frames to frames 3, and then set the Magnitude value to
03:070. Select the name, and right-click, and Key Selected. Rewind, and play that back,
03:13and see what we get. Okay!
03:15Well, that's a start, but I think that needs some work.
03:18I will need to go into the Graph Editor.
03:21So with that field still selected, I'll go into Window > Animation Editors > Graph
03:25Editor, and you will see the Magnitude curve here. Select that, press the F key
03:31on the keyboard to frame that curve, and instead of having this auto tangents
03:36interpolation, I want to select these keys, and choose step tangents. That way,
03:40we'll have a value of 5 to the magnitude for the full two frames duration.
03:47Rewind, and play that back. That's a little bit better, but I think what it needs
03:51is just maybe a greater Magnitude.
03:54Go back to the Graph Editor, select that first keyframe. It's at frame 1. I'll
03:58give it a Magnitude of, let's say, 20. Rewind; boom.
04:04Well that's the effect I was trying to achieve is exploding leaves.
04:08As you can see, fields are easy to use, and if you've already learned how fields
04:14work, then you can apply that knowledge directly to Nucleus.
Collapse this transcript
Simulating rigidity
00:00Another of the many uses of nCloth is to create in rigid, or semi-rigid objects.
00:06In this short exercise, we'll make a bouncing ball using nCloth.
00:10I've got a blank empty scene here, with my scene unit set to centimeters. Go up
00:15to Create menu, and choose Polygon Primitives.
00:19And I don't actually want to use a sphere, because the sphere has two poles on
00:23it, with lots of little tiny polygons.
00:25Instead, I want to use a Platonic Solid, because the faces will all be the same size.
00:31Go ahead and click on that, and then drag out on the grid. Press the 5 key,
00:35so we can see shading.
00:37Go to the input nodes, and let's set the Radius to about 20. Get in closer on that.
00:43And the Solid Type, I want to chose Icosahedron, which is a 20 sided Platonic Solid.
00:50And that's not a sphere, obviously, but we can just drop a polygon mesh smooth
00:56node on that, and round it out.
00:57I'll go to the Polygons menu set, and go to Mesh > Smooth, and in the polySmoothFace
01:06node, I'll set the Divisions to 2.
01:09And now I have got a spheroid.
01:10It's not a perfect sphere, but it'll behave much better with dynamics.
01:17Move that up to about maybe a meter off the ground, and then I'll make that into an nCloth.
01:24Go to the nDynamics menu set, nMesh > Create nCloth.
01:29And if I press Play, of course, it's going to move really slowly, once again, because
01:32I've built my scene at real world scale.
01:35I'll select the ball, go to the Attribute Editor, Control+A, go to the nucleus node,
01:41and I want to find the Scale Attributes section, and set Space Scale to .01.
01:47While I'm here, I will also want to just increase the Max Collision Iterations a
01:51little bit to, let's say, 8, and turn on the Ground Plane. Rewind, and play that.
01:58Okay, so we've got a crumpling piece of cloth.
02:02Next thing we're going to do is we're going to choose a different preset.
02:05Go to shape node, and click on Presets; hold that down, and we'll do a
02:09waterBalloon, and Replace all the values.
02:12And you'll see that, for example, these Pressure settings have changed. Rewind, and play that.
02:19So we've got a water balloon. What we want is a rubber ball.
02:23To accomplish that, we'll just add some Rigidity. Scroll up a little bit, and you
02:29will see, here we go: Rigidity.
02:32And I want to set that to a value of, let's say, 5. Rewind, and play that back,
02:38and wow! Wev'e got a ball.
02:40Now, we want that to bounce a lot more. We'll increase the bounciness factor.
02:46Go up to the very top of that page, and I actually want to turn off the Self
02:50Collide option, because it's just going to do a lot of unnecessary calculations,
02:55and it could actually bog down the machine, or make it appear to freeze.
03:00And I've got the Bounce here.
03:02Let's set the Bounce to a value of 20, and I'll increase the Friction a little bit.
03:07Let's just make the Friction of value of 1; that way it will not swirl around on
03:12the ground too much.
03:14And let's end range of, let's say, 72 frames in my timeline.
03:19Rewind, and play that back, and whoa! I've got a bouncing ball.
03:22Now, in this case, it seems to be a little bit overactive bouncing ball. The
03:25Bounce factor is apparently causing it to bounce up higher each time, so let's try 15.
03:34Still too much, so 12.2 we'll call it.
03:40So that's how we can do a bouncing ball using rigidity in Maya nCloth.
Collapse this transcript
Scaling time with nCache
00:00I've created this little bouncing ball animation with nCloth, and I want to use
00:05that to illustrate a cool trick you can do with nCache.
00:09To make this happen, I'm going to select that ball, and go up into the nCache menu,
00:13and Create a New Cache.
00:14I'll just play through; take a second to do that.
00:17Now I can scrub across in the timeline, and with that ball selected, I can go
00:22back to the Attribute Editor, and I'm looking for the cache node. Here it is:
00:26nClothShape1Cache1. And there are a lot interesting things you can do in here.
00:32What I'm really concerned with here is the timing of the animation, and that's
00:35accomplished through this Scale attribute.
00:38This doesn't change the size of the object in the scene,
00:42but it changes how the cache is interpreted in terms of scale of the world.
00:48If we reduce the Scale here to .5, then the cache is going to consider that that
00:55object is now half as big, and that means it'll move twice as fast.
01:01So it only took 36 frames instead of 72 to go through its motions.
01:07If it had a Scale of 2, the simulation is going to act as if the object were
01:12twice as large, meaning it would take twice as long to reach its destination.
01:17If I press Play here, you'll see it's moving at half speed. I can extend my
01:23timeline a little bit here, and I can really slow down to 1/5 speed by
01:28giving it a Scale of 5.
01:31And this is pretty amazing, because the cache is being interpolated;
01:35there is a lot of missing data in between frames.
01:38I originally only had 72 frames of cache data, and Maya is very cleverly filling
01:44in the gaps. I've taken that 72 frames, and stretched it way out to 5 times that
01:49much, and then Maya is interpolating all the in between cache frames for us.
01:55That's a pretty cool trick can do,
01:56especially if you're having problems with your cloth not moving at the right
02:00speed. You can cache it, and then go in here, and change the Scale.
Collapse this transcript
Warping objects with Input Mesh Attract
00:00Another interesting feature of nCloth is called Input Mesh Attract, and what it
00:05does is it attempts to restore the cloth to the original shape of the model. And
00:11it can be used for doing interesting things, like applying secondary jiggle
00:16animation to character skin.
00:17Here we're going to do a very simple version of Input Mesh Attract.
00:21I've got a little delta wing fighter here, and I've just got some very simple
00:26animation on it; it's just moving across the space over the course of 2 seconds.
00:30I'll select it, and convert it to an nCloth; nMesh > Create nCloth. And if I press
00:35Play, of course, it's going to move really slowly, once again, because I've built
00:39my scene at real world scale.
00:41Let's select it, go into the Attitude Editor, Control+A, and select the nucleus node,
00:46and reduce the Space Scale to .01. Rewind, and play back, and you'll see it's now
00:53falling as if it were a small piece of cloth, about the size of, like, a tea towel.
00:57Well, now we're going to play with Input Mesh Attract.
01:01Go back into the Attribute Editor, Control+A, and in the nClothShape node, Input Mesh
01:07Attract. It's here, and you will find it in the Dynamic Properties section.
01:11I'm going to set that to a value of, let's say, .5. Press Return, and I'm
01:17going to reduce this damping factor down to 0; we want the full effect here. Rewind,
01:22and play that back, and you can see we've got a weird little warp effect. Let's
01:27see what that looks like from another angle.
01:30And as you can see, it is attempting to restore the shape back to the
01:35original model.
Collapse this transcript
Tearing nCloth
00:00The final effect I'd like to share with you is tearing nCloth, and it's actually
00:04quite easy to do; it's implemented through a constraint.
00:08Here what I've got is a piece of heavy denim cloth, and it's got two transform
00:13constraints of the corners, just to hold it in place.
00:15I'll play that simulation, so you can see what is doing before the tearing.
00:21I want to tear it straight down the middle, and so I'll select these vertices,
00:26select the plane, right-click, and choose Vertex, and then select those
00:31vertices down the center.
00:33And I want to go into the nContraint menu, and choose Tearable Surface.
00:40So I'll rewind, and play that back, and you'll see it tears straight away on frame 1.
00:46Once you apply that tearable constraint, it's going to permanently change the
00:51topology of the output mesh, and you'll never be able to get it back to a state
00:56in which it was a single mesh.
00:58This has implications if you're using vertex level dynamic properties.
01:04In other words, if you're painting by vertex, then if you tear, it's going to
01:08change all that, because you've changed the topology, and it's going to cause
01:12your vertex properties to go haywire.
01:14What that means is, if you need to apply dynamic properties locally to certain
01:20areas of the mesh, then you'll need to do that through textures, and painting,
01:26rather than by vertex.
01:28So, this is going all at once. We want that to be delayed. We'll make that
01:34happen a little bit later.
01:35I've got the constraint currently selected, and here in the Attribute Editor, I
01:40have got the dynamicConstraintShape visible, and the relevant attribute here is
01:45the Glue Strength. And if that were set to a value of 1, then it would never tear.
01:50I'll play this through until we reach, let's say, frame 24, and keyframe the Glue
01:56Strength at a value of 1 on frame 24. I'll right-click, and Set Key.
02:02And then I will go a few frames later; maybe about 12 frames later to frame 36,
02:09and I'll set the Glue Strength to 0, right-click, and Set Key. Rewind, and play it back.
02:16There is going to be a transition between frame 24 and frame 36 in which the cloth tears.
02:25And it tears according to the amount of stress on it caused by the
02:28stretching here. Pretty cool.
02:32That's all there is to tearing a piece of nCloth, and that completes our title on
02:37understanding Maya nCloth.
Collapse this transcript
Conclusion
Goodbye
00:00That wraps up our course in Understanding Maya nCloth.
00:04I hope you've enjoyed this as much as I've enjoyed making it.
00:07If you want to further your studies, practice makes perfect.
00:11There is one place I want recommend you can go to check in for the latest news
00:16for Maya, and especially for Maya dynamics, and that's the official Autodesk Media
00:21and Entertainment Web site. It's area.autodesk.com.
00:26There are some very good developer blogs in there; specifically
00:30Duncan Brinsmead's blog.
00:32He is one of the Maya developers who has done a lot of work on nCloth.
00:37That's a good place to go to see the latest tips and tricks.
00:40I would like to extend my thanks to you for watching this training program, and say goodbye.
00:45Goodbye!
Collapse this transcript


Suggested courses to watch next:

Maya 2011: Modeling a Character (3h 3m)
Ryan Kittleson


Maya 2011 Essential Training (9h 8m)
George Maestri


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,069 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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

   
submit Lightbox submit clicked