• 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.
 

 

15 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!!

Add Your Comment

You must be logged in to post a comment.

Please only report comments that are spam or abusive.