PDA

View Full Version : Bullet and bones



hrgiger
02-15-2013, 01:57 PM
What is required to get bullet cloth to collide with a mesh deformed by bones? The bullet collides with the mesh but as soon as the bones start moving the cloth doesn't see the bones movement.

hrgiger
02-15-2013, 02:11 PM
Nevermind I just found it or at least I think I did. I have to set my bone deformed mesh as a deforming object in Bullet? Is that right. And just set my retain shape to 100%., stiffness to 0, and volume conservation to 0.

I just thought I would be able to set it as a kinematic object but that won't work?

VermilionCat
02-15-2013, 10:52 PM
I have to set my bone deformed mesh as a deforming object in Bullet? Is that right. And just set my retain shape to 100%., stiffness to 0, and volume conservation to 0.

This is correct but you have to bake your collision mesh before the simulation or you'll get incorrect results.

drfoley
03-08-2013, 02:54 PM
How do you bake your collision mesh?

Thanks

50one
03-08-2013, 04:04 PM
How do you bake your collision mesh?

Thanks

I think the mdd baker would help.

Greenlaw
03-08-2013, 04:32 PM
It's more efficient to use primitive shapes for the limbs, attach them to the bones and then using Bullet Kinematic mode. This will be much faster, requiring less RAM and processing, and the final result should be fairly accurate. Setting collision up this way is typical in many productions.

For example, the Bullet Deformable hair in this video is colliding with pill shaped objects attached to the arm bones.

'Sister' Motion Test (http://www.youtube.com/watch?v=jASC8IOsIqY)

Admittedly, this example could be better since very little hair appears to pushed away by the arms--the collision is working but you would see a lot more hair being pushed if I had thought to enable self collision for the hair. That aside, a setup similar to this one will work even better in deforming clothing.

G.

Greenlaw
03-08-2013, 05:50 PM
I just thought I would be able to set it as a kinematic object but that won't work?
Yes, that's correct. At first, I thought it should work with deforming objects too but Kinematic with bones is intended to move rigid objects parented to the bones. Here's an earlier test I made using Kinematic with bones--this is probably a better example since it's actually moving a piece of fabric:

Furry Carpet Test Using FiberFX And Bullet (http://www.youtube.com/watch?v=oCkuyIYHXuA)

In this example I parented a sphere to each bone in a chain and animated the chain underneath this carpet.

G.

Greenlaw
03-08-2013, 06:03 PM
How do you bake your collision mesh?

I use MD Multi-Baker. It's very easy--just select the objects you want to bake, run the tool. The tool will save a separate .mdd file for each object at the directory you choose. I also recommend the companion tool introduced in 11.5 called MD Multi-Loader. It lets you load all your .mdd files to your objects in one process.

I typically bake the results of Bullet for rendering--rendering dynamics is more stable and efficient this way. Naturally, you will not want Bullet active in a scene like this as there is no point in calculating dynamics on a baked scene during rendering. What I normally do is set up my Bullet simulations in a separate 'calc only' scene and then use the exported .mdd files in a final render scene which does not have Bullet in it at all.

Hope this helps.

G.

man777
03-09-2013, 04:59 AM
Gosh! Really good stuff!!!

I followed all your videos with delight for weeks, as I was struggling with FFX and Bullet.
I'd love to see your dynamic settings (tried to use the ones I could pick from your video), as I've been unable to do anything correct with hair.
Mine doesn't move well and I can't make them stop wriggling all along. So I went back to old cloth Dynamic. Now, I have to say my hair is not at all as yours, meaning it has a precise defined combed shape, so using fix weightmap gradients is necessary, but give the supposed fix part a ridiculous springed motion + this awful wriggling problem (even with damping).
Honnestly, I'd say Bullet is good only for hair like yours, but I may be wrong... :)

Also really impressed with your Mocap, seems to be an affordable working solution afterall.

I'm looking to watching your films soon then. Very nice work indeed. Keep rocking! :D

Best regards.

Greenlaw
03-09-2013, 05:15 AM
Thanks. I've wanted to do some tutorial videos for some time but anything in-depth would take me a lot of time to prepare so the videos keep getting put off. Maybe when we're all done I can take a poll to see if in enough users are interested in a series of paid courses. Assuming I don't immediately jump back into the workforce.

Ugh! I can't think about now though. Too busy at the moment--head will explode. :p

G.

man777
03-09-2013, 05:30 AM
Sure, I understand. I know this kind of tutorials take time.
No problem, do what you have to do, it's far more important. ;) Plus I love to resolve problems anyway, I think it's a better way do understand concepts in depth, rather than applying some defined settings without thinking.

Congrats again anyway. And thanks a lot for replying. :)

When do you plan to have your first Movie released?

Cheers.

Greenlaw
03-09-2013, 06:01 AM
As for Bullet hair settings, the trick is to make sure you have a weight map the runs from root to tip. If you use FiberFX Strand Maker to convert your curves, they will have the weight map. I think the weight map is also there if you use Edit Guides too.

Once you have this weight map, use it in a gradient under Shape Retention and set the zone between the root and about 20% to 30% down the length to 100% and have it fall off to 2% to 5%. The exact settings depends on the style and length of the hair of course, and you may need different weights map settings if the style is very complex. In generally, 100% Shape Retention makes the hair rigid and less makes it more active. Avoid going to absolute 0% because that makes it extra 'wiggly'--2% to 5% is good for the lower part of long hair.

One more note about gradients: When you put a weight map in the Shape Retention gradient, notice that the ramp starts at -100%, not 0%. This is important because it means the root point is actually in the middle of the gradient and not at the top. In other words, the falloff you want should go from 0 to 100, not -100 to 100, so you may want to set Shape Retention to 100% at around 20% of the gradient--this should leave hair at the top of the head unaffected.

One more note about Shape Retention: this not only tames the dynamics for your hair, it also help the hair return to its original groomed shape when the character is less active.

If the setup is for long hair, I also like to add a little bit of Dampening Coefficient (no weight needed) to add some drag to the hair--this makes it look lighter and just a little floaty.

Finally, set Shape Lock to Rotation and Translation. This option forces the 'stiffer' region of the hair to follow the motion of the scalp so it doesn't look so springy.

Obviously, you'll want to dial in different values for short hair and other styles but the general ideas described above should pertain. (BTW, for short 'spiky' hair, I've gotten excellent results using SoftFX too.)

In the case of the 'Sister' video, this test showed me a few things I should improve for final use in our production.

First, the current weighting on the bangs is directly proportional to the weighting on the long bits--this is just how FiberFX Strand Maker 'auto-weights' fibers. I need to adjust the weights in the bangs so that it's more weighted overall--the shorter strands should be less affected by motion than the long strands.

Second, I should have used Self Collision in this test--this would have prevented the hair from penetrating itself when the character jumps and snaps her head suddenly, and when she lifts her arms, more hair would have gotten pushed away from her shoulders.

Normally, even on commercial productions, I would leave Self Collision disabled because it can be time consuming to calculate, plus most of the time you would never notice it anyway. (Of course, with regards to past projects, I'm taking I'm talking about ClothFX since I only recently started using Bullet but the same rules apply for Bullet. Bullet's amazing speed and predictability does make using Self Collision more practical through.)

Wow, I didn't mean to write so much here but once I get started...

I guess I should copy this info over to the Production Log (http://forums.newtek.com/showthread.php?133274-The-Brudders-2-Production-Log-%28Well-sort-of-%29). :p

G.

Greenlaw
03-09-2013, 06:49 AM
When do you plan to have your first Movie released?

Our first Little Green Dog movie was Hello Frankenstein (https://vimeo.com/55180232) and that was ages ago. Our second was Happy Box (https://vimeo.com/55185005), which I think came out about a year and a half ago.

The next film (the one we're working on now,) is a music video. The real title had been floating around for a while but for now we're referring to it in public as 'Brudders 2'. This one will probably be ready in a couple of months but hopefully sooner--it may get stalled if I take a job before it's finished. The film was intended to be finished a long time ago but it's taken forever to work out all the production bugs. This project actually started about a year before we created 'Happy Box', and we made that movie to solve our mocap pipeline issues for this one. Technical issues aside, this project kept growing and growing over the years. (We must kill it soon before it takes over the world!)

After the music video is released we have another short film planned. This one will be simpler than 'Brudders 2' and it will be our first film not have cats in it. (Is that what you mean?) :)

G.

man777
03-09-2013, 07:00 AM
Woah many many thanks!!!!! I've no words to thank you for this, really. :))))))))))))))))))))))))))))))))))))))))))))

I think you answered THE point I needed.
Actually, I had figured all this by myself EXCEPT ONE thing, the fact to set Shape Lock to Rotation and Translation. I had set my body this way, but not the hair itself. I'm sure it was THE problem! I'm gonna try this right now!

Oh, wait, about Mass, correct me if I'm wrong, but I'd say that it's also an important step, I mean finding the right mass, especially the ratio between the body mass, and the hair mass. (Found that with wrong settings, hair was able to deform the body).
Say for real world measurement, what mass would you give to the hair and body???

I agree about the longer and shorter hair weight difference, it would be even better, so how do you plan to do this, select points in modeler and apply weight values manually, or better, using gradients somewhere to change them?

About the self collision, yes, I deactivate it too if not absolutely required, too long... In your case, it's true that when she lifts her arms it would be better, now adding calculation time just for a second is a pity. ^^ Would be great if we could "envelope" trig it. But hey, when you need to do things right, you have to deal with compromise. In this case, it means... adding calculation time :D

Gosh, I think you just saved my life... well at least, weeks of work. ^^

Huuuuuuuuge thanks again, and yes, copy this to the Production Log, definitely worth it!

I'm sure we are a lot to try to manage this new Bullet "hair" stuff correctly, but we seriously lack a more advanced manual (a few presets would be welcome too). Hopefully, this forum is full of good-willing guys like you are.

Also if some day, you can also tell us some bits more about your Mocap solution ( I must admit that I don't play video games, thus I'm barely aware what a Kinect is ^^)... Well, I understood vaguely the Kinnect/Body Mocap, but nothing about the fingers system for instance. Just that I'm ready to invest in "Kids gadgets". :D

Have a greaaaaaaat day my friend. :) :) :)

Greenlaw
03-09-2013, 07:00 AM
Also really impressed with your Mocap, seems to be an affordable working solution afterall.

Thanks! iPi Mocap Studio has been one of my personal obsessions for many years now. It's come a long ways since we first started beta testing this system with a couple of webcams and a laptop. The people at iPi Soft are nice and incredibly talented programmers. :)

G.

man777
03-09-2013, 07:05 AM
Ooops, didn't see your second answer.
Ok, I was just looking at your website to get these informations, all this sounds great. Gonna watch all this ASAP. :)

- - - Updated - - -

Talented, they sure are!! :D
Thanks.

Greenlaw
03-09-2013, 07:22 AM
Oh, wait, about Mass, correct me if I'm wrong, but I'd say that it's also an important step...

I could be wrong but I think this is less important with hair guides because they have no actual volume. In any case, I find it easier to adjust gravity and I have it set pretty low for hair. Naturally, if you're messing with gravity, you should do your hair calculations separately from other Bullet simulations.


I agree about the longer and shorter hair weight difference, it would be even better, so how do you plan to do this, select points in modeler and apply weight values manually, or better, using gradients somewhere to change them?

I'm going to try grabbing all the guides in the Bangs and add to the values. One of the Modeler tools will let you do this (sorry, I forget what it's called.) I'm not sure what Bullet will do with values that go over 100%--but I don't think it can go over 100%, so it's probably okay. Obviously, I haven't tried this yet.

Alternatively, I can use a UV map to quickly make point selections and reassign the weight values manually. Since all the guides will share this same UV map, this should be easy to do. Actually, this method will probably work better--and maybe run Weight Blur on the final to smooth help it out. We'll see.


Also if some day, you can also tell us some bits more about your Mocap solution ( I must admit that I don't play video games...

Believe it or not, I don't play video games either. Between family and art, I had to give up playing video games a long time ago. I miss it though. Curiously, I own four Microsoft Kinects but no XBox console, and two Sony PS Moves and six PS3 Eye cameras but no PlayStation console. :p

You have a great day too.

G.

man777
03-09-2013, 08:26 AM
They don't have volume right, nonetheless, give the body, say, a mass of 5 Kgs, and the hair a mass of 2 Kgs (ridiculous ratio indeed), and you'll see the hair will deform the body. So I wouldn't say it's not important, but you're right, not that much.
I'm glad you also came to this trick with gravity. Apart from lowering it a lot (if not completely shut it down), I wasn't able to prevent the hair from slowly falling down through the mesh. Aaaargghhh becoming bald in a matter of seconds!!! A nightmare! :D
But I'll make some further tests with a realistic given mass, just in case. In the meantime, I'll stick to your trick and separate calculations. ;)

Maybe do you refer to "Set Map value"? Mmmm gonna try this. Also the UV map stuff, sounds smart.

(Video games) Really?? Thought I was the only one left in the whole world. :D Same as you, family, job and art... I leave that to the kids. Well, I'll buy the kids an Xbox and steal the Kinect when they're asleep. ;)

(Also, forgive my poor English, I'm just a damn' froggy. ;) Thanks for your time and patience then.)

Cheers.

man777
03-09-2013, 10:21 AM
IT WOOOOOORKS!!!!!!!!!! :D (The set Shape Lock to Rotation and Translation trick) My hair ain't springy anymore. THANK YOU Sir!
Well, the fixed part of the hair does still wiggle a bit, (not the moving part), whatever the damping setting, as if struggling with the collision body or something, but it's very promising. :)