Prepackaged Water
If you want the simple and easy way of doing things, just import the following file into your scene:
nClothWater.ma (scroll to the bottom to download related material)
This creates a block of nCloth particles that you can simulate, cache and render. Open the particle shape node in the attribute editor and you will see info on how to use this (inside the notes section), as well as added attributes ( under "extra attributes") for controlling the look and resolution of the simulation.
If you scale the block along just one axis the resolution automatically adjusts to maintain a uniform particle density. It is best to render this is Mental ray with motion blur, but make sure to cache first if you want to see the motion blur. (the maya blobby render not only does not support motion blur on particles, but it also has some problems with the blobby threshold rendering) Note that to cache you need to select the nCloth shape node, not its transform, because there is no output mesh in this scene. If you wish to create constraints you can still do so by displaying the input mesh and selecting it for constraint uses.
Here is a simple workflow for a pouring glass filled with liquid that shows how one can use this cloth water file.
1. Load the water preset file nClothWater.ma.
You may need to playback and rewind once to see the correct particles as there is an initialization problem on load.


2. Create a cylinder and scale it to the desired size of your glass. Select and delete the top face to make it open.

On the nRigid node that was created turn OFF "Trapped Check" because that attribute pushes out based on the surface normal, and we are colliding with the inside of the glass, not only the outside. If you only wanted to collide with the inside then instead you could reverse normals on the glass and leave "trapped check" on. Note also that the pushout attribute looks at the normal, so it is important that you reverse the normals if you want to use that.







6. Keyframe the motion of the glass. One can also play around with the simulation by doing MENU "nCloth: interactive playback" and transforming the glass object during playback ( set your slider frame range to a large value so the simulation does not stop too soon ).



Warning: If you find that a file with nCloth no longer loads try removing the particle startup cache in you project/particles folder. Currently there is a bug where particle startup caches are saved for nCloth and nRigid nodes(on file save). The cache folders will have a name like nClothWater_startup, or nRigid1_startup and can be safely deleted as they are not used or needed. Also the 8.5 release has a bug where large nCloth or nRigid nodes leak memory and crash. Keeping these objects less than about 150 units in size will avoid this problem.
Part two of this tutorial will cover how the nClothWater file is setup and go in to more detailed examples.
The basic technique is to disable all edge and face relationships on the nCloth node, so that all that remains is point to point collision, then pipe the output of the nCloth into a particle system. We connect this output of the cloth into the particle system softbody mesh and goal mesh inputs. The particle system is used solely for its blobby particle rendering.
parentToSurface.mel
nClothBook.ma
dynamicFollow.mel
cameraFollow.mel
cameraFollowScene.ma
lightOcclusion.ma
fireball.ma
itsSlinky.ma
TunShu_BindClothSkin.zip
confettiFall.mb
simpleConfetti.ma
roundConfetti.ma
partyStreamers.ma
waterTank.ma
nClothWater2.ma
nClothWater.ma
waterPlayground.ma
Thank you! This is very useful! I’m using this method for a liquid simulation, but to make the splash a little more believable I’m trying to figure out a way to randomize the size of the ncloth particles. Do you know of a way to accomplish this?
[edit] No sooner do I post the question, than I figure out a way! For the benefit of others, I’ll post what I did here.
Make sure blobby display is turned on, as mentioned above. You also may want to turn off the Solver Display on the waterNclothShape node. I couldn’t figure out a way to randomize that, so for now I hid it and tried to pick a collision size that would accommodate all particle sizes. Then add a raidusPP attribute and add this line as a creation expression (which uses copied lines from the expression that’s already there):
float $sx = waterNCloth.scaleX;
int $xres = (waterNClothShape.resolution+1)/2;
float $size = 0.25 * waterNClothShape.particleDensity * $sx/(float)$xres;
clothOutputParticleShape.radiusPP = rand(.01,.1) * $size * waterNClothShape.blobbyScale;
And that’ll give you random particle sizes. It’ll mess up the Blobby Scale attribute, but if you’re using this for airborne liquid, that might be okay. I’m still learning, so any thoughts would be welcome!
Thanks for your great tutorials Duncan! They are very helpful!
It states that this tutorial is Part 1 of 2. Does anyone know where Part 2 can be found?
Thank you!
hi !
thx u for your tutorial, but how i convert the Ncloth objet to Particles Blobby for to have a water effect
thx u for response
see u later
if i wanna start not from a cube shape but from a sphere shape? is this what talk about the part 2 of the tutorial?
however very good job Duncan, you are the great!
Duncan, you are a rock star!!
This is nice, but I would like to see if ncloth allows an artist to add a fire effect to it. For example, in the movie Stealth, one female pilot ejected from the plane and was parachuting down. However, later her parachute got on fire and it quickly burned away the chute. How would one go about to create such an awesome and realistic effect for ncloth?
Or is there a way to add a text to the ncloth (lets say, the word “Maya”, and have the fire burn only on that text or along that text from the first to the last letter?)
What about to improve on the tear in ncloth to allow an artist to in a perfect straight line, like using the cut faces tool. This way, the cut doesn’t look like a stair step effect. It’s like using Wolverine’s super sharp claw to cut through a banana.
Check out some of the effects done by professor Ron Fedkiw and his students
http://graphics.stanford.edu/~fedkiw/




