• 1/3

nCloth Chain

Posted by Duncan Brinsmead, 26 August 2011 12:00 pm

The following file shows a method for an nCloth chain that is relatively efficient and captures the correct behavior of chain links.
area.autodesk.com/userdata/fckdata/200/file/nClothChain.zip

Basically the technique is to create links as simple cube shapes with two missing faces( each link has only 4 faces ). The links are combined into two meshes... one for odd links the other for even, and the result made into two nCloth meshes. Note that it is important before making nCloth to select the faces and to createUV: automatic projection so each vertex has a unique UV... the last step requires this even though one will not render the cloth mesh. The cloth needs high stretch and bend resistance values as well as higher substeps. The collision thickness should be set to about the thickness of the chain. The last step is to attach your chain links, which may have as high a poly count as is desired, to the simple nCloth links. First get the parentToSurface script I wrote and put in your scripts diretory:

area.autodesk.com/blogs/duncan/parent_to_surface_script
 

Position these links in the correct position, select them followed by the nCloth and type:
parentToSurface

Do this for each of the 2 cloth nodes. They should now follow the motion of the nCloth, which may then be hidden.

The same technique could be used for the central plate object, which could be a single nCloth face that has component to component constraints with the chain nCloths. Use bend/stretch/compression resistance for everything and avoid the nCloth rigidity.

 

For a faster chain  with an easier workflow: Create a long and skinny plane with about the same number of polys as the number of chain links then make it nCloth and use parentToSurface to attach your chain link objects to the cloth strip. The cloth settings should have high stretch resistance, little or zero bend resistance, a thick collision width and low compression resistance. If the initial position of the cloth has the links not fully taught then one can increase the rest length scale on the cloth a little. Increase mass for minimal drag effect and make stretchDamp zero so the chain is bouncy. I turned off crosslinks on the cloth as well so that the cloth could shear. (making the cloth skinnier would have done much the same thing, but then it could twist more easily as well, which might not be desired)  There is currently a problem with the normal direction for the follicles that can be solved by doing a poly subdivide on the output cloth mesh.

area.autodesk.com/userdata/fckdata/200/file/nClothChainFast.zip

This is not as accurate as the first method but does not require as high substeps and collide iterations. One can do a lot of chains with this method and still keep things interactive.
 

 

21 Comments

Aaron F. Ross

Posted 26 August 2011 10:44 pm

Oh, I get it, you need good UVs for the follicle node to work. Never mind!

GriecoM79

Posted 29 August 2011 5:02 pm

Awesome!!!

nbreslow

Posted 30 August 2011 7:23 am

This is a great tutorial, thanks so much for sharing your expertise - it is appreciated!

Duncan Brinsmead

Posted 22 September 2011 11:55 am

You don't need uvs for the cloth sims, although they can be useful if you paint attribute maps as opposed to painting values per vertex. Having things as maps allows you to change the mesh density and not have to repaint your attributes. In the case of the follicle (designed for the hair system) it uses uv for its position on surface, so you need good uvs on a surface when using follicle nodes.

Duncan Brinsmead

Posted 13 October 2011 1:47 pm

I think you could combine both meshes and use self collisions with no problem. It is perhaps a bit more efficient if you don't need the full self collisions, especially when colliding with high thickness. Originally I think I tried doing it with edge edge collisions for squares (not square tubes). The self collisions do not support an edge/edge method in the UI currently (nucleus does but we never created a UI option for it), thus in that case I needed to use the two meshes. Unfortunately the square method had problems because nucleus still triangulates it creating a cross bar edge in the middle of the square so my initial attempt did not work well. Nucleus would work best for this if each link were just a rectangle with colliding edges, but currently there is no UI that allows one to set this up inside Maya.

Duncan Brinsmead

Posted 21 October 2011 1:18 pm

You could perhaps combine the meshes into one nCloth and use the rigid shell feature in nCloth. Particles only self collide with spheres currently.

JimBean

Posted 9 December 2011 1:20 pm

Hi Duncan,

Is your Dec 7th presentation going to be posted on Dec 12, along with the other on-demand material?

Happy Holidays

Duncan Brinsmead

Posted 9 December 2011 4:16 pm

Hi Jim,
That presentation was pretty much the simplicity to complexity one I've already posted on this blog, but with some newer mandelbrot images.

JimBean

Posted 11 January 2012 6:49 am

Duncan, Thanks for clearing that up.
I saw your first one, I just don't see how I can use something like that.... damn pretty though.

Cheers!

geoff3d

Posted 17 May 2012 12:20 am

Your parent to surface script is not available. The link simply takes me back to the front page of your blog.

cbn

Posted 18 May 2012 2:07 pm

Hey Duncan!
Where is the old post with the Slinky? I could really use that now!

scubedio

Posted 5 June 2012 8:04 am

parent_to_surface_script is not found.... link is broken...plz upload the same...thnx for the tutorial...

enzym3d

Posted 24 June 2012 1:15 am

@Duncan
Duncan, I don't know how to contact you directly. But I have this PFX question: Can we make PFX points to slide a long curve like in a loop?

Imagine like Joints slides along curve using IK Spline. Or like object on motion Path.

On Object Level, we would use PointOnCurve node. But would like to do this in PFX component level, so I could control with Maya SOuP.

Thank you - Jimmy Gunawan

Tetsuoo

Posted 28 March 2013 11:55 am

hmm 2 rings are missing in the chain, why is that ?
I'm using Maya 2012

hang10

Posted 16 April 2013 8:53 pm

Is there a way to have nparticles emit from the collision of two or more ncloths. I'm trying to do a piece of text that breaks apart. right now I have the text as about 100 different pieces of ncloth that break apart pretty decently but I'd like nparticles emitting from all the interactions to really push the effect. Thanks!!

virtualmaya

Posted 21 June 2013 11:25 am

Please Duncan...one simple question. I have scene with rope as ncloth object and four rings as passive objects. I want to pull rope through rings, but my rope is deform to much...I increase str. resistanance, setting thickness, but my rope gets flatten shape when collide when ring....I increase substeps but it s same.

Tnx

Duncan Brinsmead

Posted 21 June 2013 4:31 pm

Do the rope as a triangular tube... any more verts in the cross section and it will collapse. Then smooth it after to make round. If you need twisted geometry then either add that as as bump/displacement, or use the mesh as a wrap deformer on the detailed rope. Another option is to use nHair for the rope.

Or you could pick the vertices on your rope and create a component to component constraint, then set the constraint method to max distance and adjust the max distance value to create stiffening links.

lmoreira2012

Posted 13 October 2013 3:15 pm

Hi Duncan, I had a ncloth related question but wasnt sure where to post it. I have a ncloth mesh Im using to simulate skin. but even after painting properties and tweaking some parameters Im getting more movement than I wanted in certain areas. Im curious if would suggest a method for cutting up the geometry and applying ncloth to the areas that I want to isolate the effect for, and then combining everything back into a final mesh. Im wondering if it could be more efficient too, as it wouldnt be calculating the ncloth for the entire mesh, but only for those desired parts. Thanks!

Duncan Brinsmead

Posted 15 October 2013 8:56 pm

In Maya2014 the input attract on nCloth was modified so that a value of 1.0 can totally lock the vertex position as well as being more optimal( self collision, for example, does not get computed for locked vertices ). One can paint the per vertex values to 1.0 in all the locations on the mesh you wish to fully track the input mesh animation.

A somewhat more complex workflow ( but potentially more efficient in some cases) is to do a poly separate on your mesh( preserving history ) splitting out just the dynamic bit( like the bottom of a pant leg ). Then make this cloth and paint input attract = 1 on the boundary vertices. Take the out cloth mesh and combine it with the other part of the mesh an do merge vertices and smooth normal on the result to get the final mesh.
This can be more optimal than the first technique because the cloth solve doesn't need to initialize and build a bounding tree for the full mesh.

John D Ebner

Posted 27 November 2013 4:53 am

duncan

can you see if a tool like this can be built as a mel script?

its not that deep of a tool but should be called
ReVolooption

I am looking for a loop loft tool the creates a nurb curve from the centroid origin on a model, but the spline slides over top of a surface and has
extra features to it

seen one in any app yet?

seen a mel script in maya of one yet?

essentially it functions similarly in display to a cross section tool
or how camera can be used to dolly image plane clipping plane in and out of a view

ONLY that the clipping plane is the shell boundary of the polygon sub D or nurb curve surface..
the tool itself harnesses and has extra tools to it
that uses the centroid origin of a model and it can automatically create a centroid origin SPLINE much like the time line points in animation only that if you imagine the
origin to be the nerve center for how a spline is traced directionally over a surface then this will allow for much more robust resurfacing controls over a surface within maya

Second
if the model has limbs etc
it can slide the centroid accordingly to any of the limb centroids. The tool then has the ability to create a loop spline which allows any artist to re-loft from a new set of clean isoparm splines that are NOT directionally dependent.

to slide along a centroid which you can slide along its circumference the loop of a spline that is closed or OPEN and then tweak as you grow additional splines draping over top allows a modeler to resurface a model in mere seconds manually rather than hours.

stigla

Posted 24 December 2013 11:31 am

Reply to Tetsuoo:
The UVs on two folicles are wrong in nClothChain.
Change UV values on them.
Find the chain which is a bit off, then change the UV value on the folicle above that chain. To find the right value, choose one of the faces where the chain is missing and check it's UV values in UV editor.
The top value is horizontal, next value is vertical value of UV.

Add Your Comment

You must be logged in to post a comment.

Please only report comments that are spam or abusive.