ncloth isnt too bad for this, but theres always other ways…
Dynamic Chains, and lots of em
The positive is at least the only way is up for Maya RB cause it cant go any lower :shrug:
The following file shows a method for an nCloth chain that is relatively efficient and captures the correct behavior of chain links.
http://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:
http://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.
Duncan
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.
http://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. 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)
Duncan
Yes the follicle nodes attach to a specific uv location on a surface. The parentToSurface script won’t work well if a surface has non-unique uvs. It is kind-of a pain, but an advantage is that one can slide the follicles over the surface by animating the follicle uv. The other nice thing is that one can change the topology of the mesh and the follicles will still stay in the same position.
Duncan
Duncan why do we have to use proxy objects while doing RB simulations with nCloth, is it because nCloth is not designed for RB sims?
The output of nCloth is animated vertices, not animated translate/rotate as is the case with a rigid system. The above workflow is basically making simple cloth objects “relatively stiff” then attaching rigid meshs to to the cloth( like buttons on a shirt ). With cloth one can make it stiff easily only for very simple meshes. The time to compute cloth stiffness goes up exponentially with mesh resolution, so it helps to keep the cloth as simple as possible. Usually this makes the the cloth simpler than the model we wish to render and the cloth will still deform a little thus the need in this case to attach a rigid mesh to the cloth surface and hide the cloth.
There is a rigidity attribute on the cloth that is essentially a rigid body solver inside the cloth solution, but it is not very practical for things like chains, as one would need too make each link a separate cloth object and I think it might get slow and have poor collision behavior( although I’ve not tried it ). The rigidity attribute can be useful in some cases, but it is not a substitute for a rigid body system, and often it works better if one keeps the mesh simple and relies on bend/stretch/compression resistance.
Duncan
I did try using the concrete preset on low res poly links but like you said, I had to make each one an nCloth object and it wasnt very practical. Collisions worked okay with substeps close to 20 but I couldnt achieve free flowing rotations between the links as if friction was too high, but even with low friction values the problem still persisted.
Your method is far more efficient.
Is a RB solver something you guys will be working on in the future?
Hi Duncan,
I had a look at your nClothChainFast-solution and i think it is very smart, thanks!
One thing I have to solve though is an issue I only encounter when I rebuild your scene with a different chain-mesh (shorter and less follicles):
Compared to your nClothChainFast.ma scene my follicles freak out during fast and jerky chain movements. It seems as if they can’t keep track of the right normal direction.
I created them like you wrote, using your script after having created a clean mesh with clean UVs. Are there any tricks you can share to make them more “stable” during heavy mesh movement?
Thanks in advance,
Fridi
I’m not entirely sure why, but it should fix the problem if you add divisions to the output cloth mesh, or instead you could smooth it. It might have something to do with the way triangle coords or normals are interpolated when the triangle is stretched.
Duncan
Hi Duncan,
How could I apply your fast chain approach to a rope, basically a cylinder, rather than chain links? Thanks.
Tim
A rope is easier. One need not handle the free compression of chain links or instancing links along the strip.
Just create a long skinny poly plane with subdivisions along its length (a strip of square quads), then make it nCloth, constrain and simulate as desired. You might not want any bend resistance on the cloth. To render a rope shape, you have a few options, although a simple technique is to extrude the output cloth(with history) to make a square tube, then smooth the result to make it a round tube. The finer detail on the rope could be handled with bump or displacement maps if needed. Another approach might be to paint a pfx stroke along the strip and convert to poly( or to nurbs curve and then model based on that ).
Duncan
Thanks Duncan,
One problem…it’s collapsing at the end of the cube, seems to not keep its original volume. I have it constrained at one end and that end is keeping its volume but the opposite end collapses and flattens out. Is there a way to fix this?
Also, I’ll let you know what I’m shooting for, if it may make a difference. I’m looking for the best way to wrap a rope around a spool. Basically the spool, perpendicular to the rope, will be rotating, winding up the rope. The scenerio is the rope will manufactured by a machine and then wrapping on the spool. So, the spool will pulling the rope out almost. I hope that makes sense.
Thanks
Tim
If I understand you correctly, it sounds like you are simulating on the extruded plane, rather than doing it downstream of the cloth. You want to simulate the flat strip, then extrude the output cloth mesh( not the input one) along the surface normals to give it thickness. (in terms of collisions you can use the thickness on the cloth node)
Duncan
The spool animation should be as simple as:
- create nCloth strip
- make spool a passive collider
- do point to surface constraint of the 2 vertices at the end of the cloth strip to the spool
- keyframe the spool rotation and playback.
If you have stretching or collision problems, increase substeps and stretch resistance.
Duncan
I think you’re right, I didn’t extrude the correct mesh initially. I went back and did the following…created a plane 1 by 20 with 20 subdivisions. Made that nCloth. Created cylinder and made that a passive collider. Constrained the 2 closest vertices to the cylinder using point to surface (I used transform before and that seemed to work too, would that matter?) Then ran playback, and it worked good. cloth wrapped around cylinder. Then I selected outputCloth1 and extruded that. Ran playback and seem to have the same problem, it keeps volume on top of the spool but as it drapes over the edges it flattens.
Thanks for the help, Duncan. Obviously, I’m a dynamics novice so please bear with me. I really appreciate the assistance.
Tim
I think you are hitting a bug where the normals used by the extrude are not properly updated for the deformed cloth mesh. You can work around this by doing normals:softenEdge on the mesh before the extrude. This insures that the extrude has computed normals to work with.
Duncan

