PDA

View Full Version : ncloth: working with rigid bodies ?!


goja
01-22-2009, 10:11 AM
Hi,

I'm doing some test with ncloth lately in maya 2009, and have to say that I'm really astonished by it. Great work!

I've got a problem though, to have it work with rigid bodies.

I want to build a rope with objects attached to it that swing. Now the objects should be rigid of course.

As a rope I use a poly-cylinder, it has a "transform constrain" on the vertices at one end. The object is attached to it at the other end with a "component to component constrain", both are ncloth objects.

As I learned already true rigid-bodies aren't implemented in ncloth yet. So I'm turning up the "resistances (stretch, compression, bend, deform)" and the rigidity.

But when I move the rope to a start point (simulating) and set "initial state -> use current" and have an object with rigidity on it, it just explodes at the first simulation frame.

So for now the only way - when working with "initial state" - is to keep the rigidity at zero, and turning up the "resistances", which actually works, but I would prefer to use "rigidity", to be sure to have (nearly) no deformations.

Maybe this workflow with ncloth-objects isn't the best for this rope-object situation, anyway? It would be great to constrain non-ncloth objects to ncloth simulations, is this possible?

Thanks and greetings
Jan

BTW: Is there a way to get ncloth working with multithreading?

goja
01-22-2009, 01:27 PM
I'm trying to use some ncloth-proxy now to solve this issue.
So I want to simulate the ncloth movement and then assign this movement to another object.
I've cached the simulation and tried to bake it, but when I constrain or parent another object to the ncloth it doesn't move.
Even so I get the transformation only baked on vertices, not on the whole object.

Does anyone know how to bind non-cloth objects to ncloth simulation transformations?

Duncan
01-23-2009, 06:08 PM
The simplest method is to attach an object to a point on the cloths surface. The cloth will push the object around, but it will not affect the motion of the cloth. To do this use the parentToSurface script from by blog:
http://area.autodesk.com/index.php/blogs_duncan/blog_detail/parent_to_surface_script/

If you need the object to interact with the cloth then there are a couple of options.
1. Make the object nCloth with rigidity and constrain it to your other cloth (turn off self collisions on the rigid cloth because they won't be needed)
2. Model a simple proxy object (could be as simple as a single poly ) make it cloth and constrain it to your other cloth. Then use the parent to surface script to attach your object to the proxy cloth object. This helps keep the simulation simple. Note that the fewer the polys in general the higher you will want the mass to be set.

Duncan

goja
01-26-2009, 09:35 AM
Hey duncan,

thanks alot!

Great script, it works just as I needed!

Still got the issue when dealing with rigidity and initial state, though. (The "rigid" object just jumps to somewhere on the first frame of simulation, when I use initial state. when rigidity is at zero it works fine...).

Duncan
01-26-2009, 05:23 PM
Setting initial state on the rigidity simualtion currently does not work because it does not cache the internally computed transform used by the rigidity code. As a result it will think the object wants to be at the original start position, not the initial state position, and will strongly attract to this position at the first frame.

A potential work around is to use very high stretch/compression and bend resistance with no rigidity. Additionally one can create component to component constraints within the cloth to stiffen it. On the constraint one can set connectionMethod to Max Distance and increase the max distance to create lots of links (lowering connection density can avoid too many).

Another workaround is to make the initial position of the cloth match the position that one did set initial state to. One could duplicate the output mesh and replace the nCloth input mesh with that duplicate(one would also need to clear the initial state). Or one could simply hand transform the cloth to the desired initial position instead of solving and doing setInitialState.

Duncan

CGTalk Moderation
01-26-2009, 05:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.