Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
Theme color:
  • 1/3
You are here: Homepage /  Blogs /  Duncan's Blog / Grab and release nCloth
Grab and release nCloth
Posted: May 14, 2008
Category: nCloth
Social Media:
Bookmark and Share
 
For grabbing cloth the key technique to use is to animate the enable on the constraint. When a constraint becomes enabled it reforms its connections based on the relative distances at the time it is enabled.

In this tutorial we will grab a simple plane of cloth with a cube. In a real world scene one could substitute an animated hand for the cube and the simulation would still work the same. A nice property is that the deformation of the hand would also be taken into account. One could instead try to grab by closing fingers of a hand around the cloth and using friction, but that would be much more difficult to simulate than this method.

1. Create a simple cube and plane. Make the plane nCloth and on the nucleus node turn on usePlane on the nucleus node so that the cloth just sits on the ground. The cube will represent our grabby hand. Keyframe it moving around as you wish the hand to move.
2. Select 2 or more vertices on the cube where you wish to attach along with the cloth plane and create a point to surface constraint. (You can enable collisions on the cubes nRigid node if you additionally want the cloth to collide with the cube) Note that you need at least 3 constraining vertices if you want to be able to twist the cloth in any direction by rotating the cube. If you had used vertices on fingers then the cloth would also respond to the relative motions of the fingers.
3. Key the enable attribute of the constraint ON when you wish the "hand" (cube) to grab the cloth and OFF when you wish to release it. This can be repeated multiple times and the attachments will always be formed at the frame where enable is keyed ON.
In order to post any comments, you must be logged in!
Newest users comments View All 13 Comments
Posted by Duncan Brinsmead on Sep 20, 2010 at 03:15 PM
For a magic carpet, first animate a plane mesh with the general desired motion. Then make it nCloth and use the input mesh attract to have the cloth follow your animated motion... the input attract can be animated depending on the desired motion. You can use the wind and lift/drag features on the cloth to get it ripple and flap as it moves through the air. You may wish to paint the input mesh black in some areas to allow them to flap freely.

Duncan
Posted by hash on Sep 18, 2010 at 01:27 AM
Hello sir,

With ncloth is it possible to create a magic carpet ?
What would be the best way

Many thanks :)
Posted by hash on Sep 18, 2010 at 01:27 AM
Hello sir,

With ncloth is it possible to create a magic carpet ?
What would be the best way

Many thanks :)
Posted by hash on Sep 18, 2010 at 01:27 AM
Hello sir,

With ncloth is it possible to create a magic carpet ?
What would be the best way

Many thanks :)
Posted by JimBean on Oct 03, 2008 at 06:00 PM
Hi Duncan,

Now that Maya 2009 is out, just imagine this...

There's a huge crowd of, well let's face it, geeks, chanting DUNCAN! DUNCAN DUNCAN...

And what do they want? Oh, you know what they want.