PDA

View Full Version : Multi-layer Cloth



Chrusion
02-28-2013, 11:47 AM
How do you setup and sim multi-layered clothing using Bullet?

It's not a problem to get the first layer of a garment to sim as desired, it's getting the second and third layers to properly interact/collide with the underlying cloth meshes that's the problem.

Setup = subD human character without any bone rig setup/enabled, just a T-pose and keyframed to rotate 90 deg on bank as a simple test of cloth layer 1 collision. It is set as kinematic in Bullet. Bank rotation + Y translation = 20 frames, sim length = 60 frames. All objects have SubD order = last.

Cloth layer 1 is a SubD long robe/tunic with long sleeves set as deforming body in Bullet. This layer sims nicely. Next I add ClothFX to the mesh, run File > Scan Motion and save the default named MDD in the default Dynamics folder.

Next I disable the character body in Bullet, change the Tunic deforming mesh properties to 100% everything (shape ret., linear/angular stiffness, damping coef.), add the second SubD cloth layer (an long over coat) set as deforming in Bullet with the same properties the tunic had for it's sim (now baked to MDD by ClothFX).

The problem is, the coat doesn't follow the tunic's visible motion in world space, just the collision with it as if the tunic were not moving up on Y and rotating on Z. I understand that under the playback control of the ClothFX MDD that it's only the vertices of the tunic that are moving, not the actual mesh pivot point, but why is the coat only seeing the collision deformation of the tunic (wrinkles and gravity), but not its world motion as seen in the viewport? That is, the coat remains fixed in place, yet deforms to the shape of the tunic as if the tunic were not moving/rotating.

112043

Chrusion
03-01-2013, 11:28 AM
Interesting. No one here has done multi-layered cloth! Well, what to do now. It can't be impossible with all the advanced tools available in LW now.

ranhell
03-01-2013, 07:02 PM
I have not done this in bullet yet only with the old dynamic fx I'm still trying to under stand why deforming bodies is not stable....

Surrealist.
03-01-2013, 10:29 PM
Is that the bones rotating or just a mesh? I wonder if it makes any difference.

Surrealist.
03-01-2013, 11:15 PM
And another point in question. Technically in this set up it is in effect a cloth dynamic node driving the mesh. Even though it is mdd it is being driven by or rather passing through the old cloth dynamics. (I mean just a guess, I have no idea what is happening under the hood)

I wonder if you took the mdd and put it through a DP MDD node it would work differently? I don't know if the new Bullet was meant to interface with the current dynamics system. But that might be it.

lwanmtr
03-03-2013, 08:40 PM
I tried once to mix the old dynamics and bullet with no success...the two dont seem to play well together, or there are more steps to get them to.

Have you tried setting up both cloth layers to calculate in the same session? Will be a longer calculation time, but then you would get the interaction of both against each other.

metahumanity
03-04-2013, 04:39 AM
Wouldn´t baking to mdd work? Bake the first layer and make the second react to that and so on?

Surrealist.
03-04-2013, 05:36 AM
Did you read the thread?

RebelHill
03-04-2013, 09:07 AM
Its an evaluation order problem...

You should try applying the MDD for the first layer using the displacement node interface, and then set the displacement evaluation order lower to try and get it "pushed" onto the mesh before bullet evaluates (which may or may not be possible to do, havent tried).

The other option would be to have both cloth objects in the same mesh layer as one another and get bullet to sim them together, using self collision.

Chrusion
03-04-2013, 12:40 PM
Update: A couple of params listed in the 11.5 Adendum made the difference in getting the first cloth layer mesh to drive the collision of the second layer.

I haven't refined everything, so this is a very rough start:

1. Animate collision driver mesh (bones, translations, deforms, etc.) as desired
2. Set it as Deforming Body in Bullet

Collision Margin = 0
Shape Ret. = 100%
Shape Lock = Trans/Rot.
Linear Stiffness = 0
Angular Stiffness = 0
Vol Conserve = 0
Friction = as desired


3. Add first cloth layer mesh set as Deforming Body in Bullet

Collision Margin = as desired
All other params = as desired for stye of cloth sim


4. Run sim (adv. to last frame). Adjust sim as needed.

5. Add Cloth to first cloth layer's Properties Panel > FX tab.
6. File tab > Scan Motion
7. Save MDD

8. Disable collision driver mesh in Bullet (uncheck object)
9. Change first cloth layer in Bullet to:

Collision Margin = 0
Shape Ret. = 100%
Shape Lock = Trans/Rot
Linear Stiff = 0
Angular Stiff = 0
Vol Conserve = 0
Friction = as desired for second cloth layer


10. Add second cloth mesh and set as Deforming Body in Bullet with desired params for sim.
11. Calc sim.
12. Add Cloth to second cloth layer's Properties Panel > FX tab
13. File tab > Scan Motion
14. Save MDD

15. Rinse and repeat (should work) for any additional layers, remembering to disable in Bullet the object that previously drove the collision of the top-most object when adding a new mesh layer so that the newly MDD scanned object becomes the base collision driver for the new mesh layer).

The key was resetting each "finished" cloth layer's Shape Lock to Translate & Rotation and setting Linear, Angular, Vol Conserve to 0 and Shape Retention to 100.

With that said, it takes a butt load of tweaking Bullet soft bodies to minimize cloth meshes from penetrating the underlying collision driver, getting partially stuck inside, and then jittering into a mass of quivering polys, for example, when bringing an arm down to the side of a torso from a T-pose, pinching the cloth inbetween. Self collision doesn't seem to fix this.

Anyway, like I said, this is a start and maybe it's pushed as far as it can go, maybe not. Right now I'm working on a human walk cycle using the first Genoma biped rig in its default preset list to see how arms swinging back and forth with all that pinched cloth between works. I have extremely LOW expectations for success.

Currently I'm not getting the Genoma rig to perform well at all in driving the legs of my person. The knees want to bow out badly even when the knee "target" gizmos are positioned so the knee bones are straight ahead the same as in the rest position, rotating the leg. Not sure how to fix to make it stop doing knee's-out-to-the-sides squats instead of bending straight out in front.

RebelHill
03-04-2013, 12:52 PM
when bringing an arm down to the side of a torso from a T-pose, pinching the cloth inbetween.

This is generally down to how close the body mesh parts come to one another. If they get so close that they impinge on the offset envelope of the cloth, a twitchfest will ensue, and if the mesh of the arm penetrates the mesh of the body, with cloth between the 2... its forget about it city.

Chrusion
03-04-2013, 12:53 PM
Have you tried setting up both cloth layers to calculate in the same session? Will be a longer calculation time, but then you would get the interaction of both against each other.
Yep, at the start of the research... it no workie. Been awhile, but I think the second cloth layer "disabled" the first so that the first didn't move an iota. Could've been user setup error, too. Would be great if Dynamic could handle the following real life situation: scarf over coat over sweater over shirt and tie tucked into pants. hehehe. I know, I know, model and animate ONLY what you can see.

Chrusion
03-04-2013, 12:56 PM
if the mesh of the arm penetrates the mesh of the body, with cloth between the 2... its forget about it city.
I figured as much. So basically don't even spend another minute trying. There's NO way of rigging a T-pose to NOT pinch and interpenetrate itself. If there is, I'd like to learn.

RebelHill
03-04-2013, 01:14 PM
I figured as much. So basically don't even spend another minute trying. There's NO way of rigging a T-pose to NOT pinch and interpenetrate itself. If there is, I'd like to learn.

Well sure there is... careful well made rigs for one... a second useful trick is to use morfs to "shrink" down the mesh in problem spots/poses.

lwanmtr
03-04-2013, 01:39 PM
A little off topic, but...

In reguards to t-pose... Genoma allows much easier rigging of characters in a non t-pose, so you could model closer to a relaxed pose.

Kevbarnes
03-04-2013, 02:12 PM
Check out this video of Lino Grandi from Siggraph. multi layer Cloth starts in about 7mins 38s

Link:
http://www.youtube.com/watch?v=183KE2sjvf8&list=PL157C85AD4EBA4F4F&index=4

Chrusion
03-04-2013, 09:38 PM
Yes, seen that. But, this doesn't compare at all to real world application in a real production pipeline. I'm waiting to see multi-layer cloth (cape, baggy/loose shirt, tie or jewelry chains around neck, etc.) on an extremely energetic, fighting character, that or a tutorial of something with less dynamic movement, say, simple walking/running.

Chrusion
03-04-2013, 09:42 PM
careful well made rigs for one...
I thought that's what Genoma brought to the table for those less experienced in rigging (raises hand WAY high). Sadly, I'm finding that not to be the case or as intuitive as I thought it should be.

lwanmtr
03-04-2013, 09:52 PM
I've found Genoma to be quite easy to use, watch the vids on the Lightwave site. Its all about moving the points around.

RebelHill
03-05-2013, 04:15 AM
I thought that's what Genoma brought to the table for those less experienced in rigging (raises hand WAY high). Sadly, I'm finding that not to be the case or as intuitive as I thought it should be.

In some respects... not in others though. Genoma certainly doesnt make it that easy to get good deformations in a lot of instances, (shoulders being a prime example), that's one of its shortfalls. Try some of these chars here to see the difference... http://rebelhill.net/html/shares.html

lwanmtr
03-05-2013, 04:39 AM
Simple weight maps easily fix the major deformation problems.

Also, once you get to know how to put things together, its easy expand a rig to add bone to handle some fixing.

Of course, Genoma isnt an end all be all, but a great way to get started.

RebelHill
03-05-2013, 04:41 AM
Simple weight maps easily fix the major deformation problems.

Yeah... often, not that simple Im afraid. There can be a great deal more to it.