Dynamic Chains, and lots of em


#1

Hey!

I just started working on an old laid-off project, a chaos space marine commander. Once I’ve done all the detailing, the plan is to make it fully animated.

So, as you see in the picture below, one of the shoulderpads has these chains on it, and they will need to move in a dynamic way.

I tried, just to make sure, and I was pretty sure it wouldn’t work, to just make the whole thing into one active rigid body sim, and it nearly lagged stuck on my computer (which is pretty beefed up). Clearly it’s too heavy for any home computer to calculate, at least in one big chunk, with default settings.

So my question is, what’s the best way to go about this? How do i streamline the simulation? Just to clarify, I’m nearly a complete novice on dynamic simulation, so thorough tutorials or thorough advice would be appreciated!


#2

Have you tried nCloth?


#3

And here comes the part where my novice knowledge of dynamics in general requires “Thorough Answers”.

To answer your question directly: Yes, I’ve fiddled with it, made tablecloths and a flags. But I’m guessing you don’t mean “Have i tried nCloth” in the literal sense. So please, elaborate what you mean.

As i said in my original post, the only thing I’ve tried with this project is to make every link an active rigid body, and that worked out as described in the thread start - Not all that good.

I’m sure, in theory, it would work splendidly if I had a whole bunch of computers just crunching the dynamics simulation, but i don’t. Single-computer solutions please :stuck_out_tongue:


#4

I’d go with either a better rigid body engine - PhysX or Bullet or drive this with a hair curve and an IK chain.


#5

I just had a go with nCloth and its not much better with sim times, Id go with another solver, maybe even dynamica.
http://forums.cgsociety.org/showthread.php?f=86&t=675357&highlight=dynamica

I cant see this working with a hair curve and IK chain, what about collisions?


#6

carefully placed collide spheres :wink:

No i think the dynamica/bullet solver is the way to go here. It should breeze through those chains, they’re really pretty simple. Maya’s own solver just hates things like that - too many interpenetrations. It’s a creaky old solver now. Autodesk should just licence Bullet or PhysX for 2011/2012 imo.


#7

Sounds like a lot of hard work to me.


#8

ncloth isnt too bad for this, but theres always other ways…

http://forums.cgsociety.org/showthread.php?t=848517


#9

When have dynamics ever been easy! :banghead: :cool:


#10

The positive is at least the only way is up for Maya RB cause it cant go any lower :shrug:


#11

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


#12

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


#13

Is the UV layout for applying the rivets?


#14

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


#15

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?


#16

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


#17

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?


#18

awesome D, even better than Johns idea :wink:


#19

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


#20

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