Main

Combining Ragdoll physics with Motion Capture animation | Rokoko Smartsuit 2 | Blender Secrets

In this video we look at the process of combining Ragdoll physics with Motion Capture animation (mocap). This method is easy, as you don’t have to do anything to set up the Ragdoll physics. You can simply import the file I’ve prepared and follow the steps described in the video. One thing I would recommend in addition to the workflow in the video: It’s convenient and easy to auto-rig with Mixamo. But it’s even better to do the rigging yourself, for example using Rigify (which comes with Blender by default). That way you have a proper Root bone, which makes the process easier. So it’s a bit more work in the beginning, which will pay off later. I’ve been trying to finish this video since forever, but was stuck until I got the Smartsuit Pro II from Rokoko. Because it allowed me to record myself getting up from the floor. That might seem like something simple, but it’s a movement that I could never record before, because both feet are away from the floor at some point. The new smartsuit had no issue with it. It also wasn’t bothered by any magnetic interference in my apartment. So all in all a big upgrade! Rokoko Mocap suit (affiliate link) https://rokoko.co/3O7UZBz If you don’t have the funds (or need) for a Smartsuit, you can also use the free Rokoko Video method that just uses visual input: https://rokoko.co/secrets Mocap Playlist https://youtube.com/playlist?list=PLrB1kuJIjcg5p5rp38MV-TKYP8x4jG8-x Previous videos about Ragdoll physics: https://youtu.be/whNU_0LCBCM Easy Ragdoll https://www.youtube.com/watch/CI5Pf2Rj5No More Realistic Ragdoll https://youtube.com/watch/r9lWt6iwbXQ Ragdoll with Armature Get my free Ragdoll blend-file here: https://www.blendersecrets.org/secrets/combining-ragdoll-physics-with-motion-capture-animation Animation Layers add-on: https://blendermarket.com/products/animation-layers Thanks to Pierrick Picaut for helping me figure out some animation issues as well! Check out his Blender animation masterclass here: https://www.p2design-academy.com/?affcode=1114550_uumzfl5p

Blender Secrets

7 months ago

For a while now, I've been trying to find an easy to use method for combining ragdoll physics with mocap animation, for example, for getting up after a fall. With, shall we say, limited success... The reason I kept failing, was because I was trying to make everything really complex, trying to do everything with one rig. By simplifying things as much as possible, I was finally able to mix ragdoll and mocap animation. A big “thank you!” to Rokoko for making this video possible. First, you'll need
a ragdoll that has rotation constraints so that its arms and legs don't move in impossible angles. I've described in previous videos how to make this kind of ragdoll. But, since I've already made it and fine-tuned the constraints, you can skip all that work and just download it from my website. Note, that the hitboxes have to be set to Start Deactivated. That way, the physics simulation starts only after they're hit by another object. As a side note, the Rigid Body connection Empties have to be
parented to the hitboxes, so that the connection works well. But don't worry, this has already been taken care of in my Ragdoll file. Then record some mocap actions for your scene. If you need some special kicks or actions that you're not able to do, or you don't have a mocap suit, the Rokoko app has a Motion Library of performances that you can choose from, including some free ones. In case your character still needs to be rigged, I recommend doing this online in the free online Mixamo auto-rig
ger. Make sure that you download it in a T-pose, and check Automatic Bone Rotation when importing the file. As you can see, the auto-rigged character is now in a T-pose compared to the ‘kind of T-pose’ it was in before. This will help a lot with properly retargeting the animation. I like to set the Armature to In Front and to display as ‘Sticks’. Import the FBX file of the mocap animation and use the free Rokoko add-on to retarget it to your characters. I highly recommend renaming the Armatures
in advance. That will avoid confusion during the retargeting process. Pick the Source and Target Armatures. Click on Build Bone List. Check the Bone List for any mistakes. And then click on Retarget Animation. You can delete the source Armature. In this video I’m using the Animation Layers add-on. It’s a commercial add-on, and if you want a free alternative, I did make a couple of videos that you can check out. I recommend getting this add-on if you often do animation in Blender. To use it, fir
st enable it. Then add a new layer. Turn on auto keying and add some adjustment keys. And that’s all. It’s a very easy to use add-on and it really makes animating in Blender much more fun. Just remember to turn off auto-keying at the end. Append the ragdoll from my ragdoll Blend-file. Open the Collections folder inside of the file. And append the “Ragdoll” Collection. Go to frame 1. Go to the point where your character has to do a stunt. Move it to rougly overlap the character. Parent a Passive
Rigid Body, set to Animated, to the Bone of whichever body part first collides with the ragdoll. Here I’m moving the 3d cursor to the selected Bone. Then any object added, like a Cube, will be in that location. Scale it down. Turn the Cube into a Rigid Body. Set it to Passive and check “Animated”. Hold Shift and select the Cube and then the Armature in Object Mode. Then go to Pose Mode. Parent the Cube to the Bone with Ctrl+P > Bone. The Passive Rigid Body Cube now follows the foot. Now Bake the
Rigid Body cache. The floor needs to be a Passive Rigid Body object. Instead of parenting a Passive Rigid Body to the kicking foot, you could also use a separate animated Passive Rigid Body object. That way you have more control over the speed and the movement. Once you’ve got something that you’re happy with, select all the hitboxes while holding Shift. Then bake the simulation to keyframes. Now we have the Rigid Body cache baked to keyframes. This way, we can’t accidentally lose the Rigid Bod
y animation. You can now hide or delete that Cube. One issue we need to fix is that the Rigid Body animation starts too early. Select all the hitboxes in the Ragdoll collection. Then move all the keyframes a couple of frames forward in time. You can move the keys by pressing G. Now the impact looks better. Unhide the hidden character and create a new Animation Layer. Rename the new layer “stunt” for clarity. Go to Pose Mode. Make sure that Auto Keying is enabled. Select all the bones and set a L
ocation & Rotation keyframe just before the impact. Then move forward in time a few keyframes, and pose the character to match the ragdoll. The poses don’t have to perfectly match the ragdoll, as long as it looks okay. After finishing one key pose, go forward in time a few frames, and do the next one. To make things easier to see, select all the hitboxes... Then while holding Alt, check the In Front option. And while still holding Alt, set Display As to Wireframe. Whenever you have bones that ar
e in a really weird pose, you can select them and then press Alt+R to reset their rotation. You don’t even really need to set that many keyframes. You can set more keyframes, to accurately follow the ragdoll, but I find that a small amount of keys already looks fine. It depends on how realistic or stylized you want the result to be. Finally, add mocap for the part after the ragdoll animation, when the character gets back up. I recommend importing the mocap FBX in a fresh Blender file that has yo
ur character in it. Then retarget the animation as you’ve done before. You can delete keyframes that you don’t need. Because the physical difference between this character and myself, there’s some clipping of the hands into the body. To adjust this, you can open the Graph Editor window and then in Pose Mode select a bone that you want to adjust. Press the Home key if you don’t see any of these keys in the Graph editor. Double-click on one of the rotation channels. Then move the keys up or down o
n the Y-axis by pressing G and Y. This way you can make some quick adjustments. Open a Dope Sheet window and set it to Action Editor. Then name this Action appropriately. Then, save the file with a clear name. Back in our main file, open a Nonlinear Animation window. Click this button to see only the animation of the selected object. Append the Action from the other file. Select the top layer in the Nonlinear Animation Editor. Add a new Track. Select the new Track and press Shift+A. Choose the “
Getting Up” Action. Find the right point to start the Action and press Y to split it. Then you can delete the part that you don’t need. Set a Blend In value of 1 frame. We need to move this Action forward in time. It looks like it should start around frame 400. As you can see the getting up Action starts in a very different location. Normally it would be easy to solve this by simply moving the Root bone and setting keyframes for that. Unfortunately, Mixamo rigs mysteriously don’t have Root bones
. However, we can still kind of add a Root bone ourselves. In Edit Mode, extrude a Bone. In this case I extruded it from the Hip Bone. Name it the Root Bone. Select the Hips Bone, and parent that to the Root Bone. Now we can use this improvised Root Bone to change location and rotation of the character with some keyframes. Add a new animation layer. Select the Root bone in Pose Mode. Go to the last frame of the Ragdoll animation. And set a Location / Rotation keyframe. Then go to the next frame,
and position the Armature where it should be. I recommend using Auto Keying for this, so you can quickly iterate and find the right pose. Press back and forth to toggle the previous/next frame and compare visually where it should be placed. Now that the position is solved, there’s still some ugly movement where the next Action suddenly begins. Before we fix that, let’s give a proper name to this animation layer. Create a new animation layer. On the last frame of the Ragdoll animation, select al
l the bones except the Root, and set a Location / Rotation keyframe manually. Go forward a few frames and set another Location/Rotation keyframe. Copy the pose of the last frame of the Ragdoll animation with Ctrl+C. Go one frame forward and paste the pose with Ctrl+V. Set a Location / Rotation keyframe so that the pose is recorded. Now we need to move the Armature back to the right location. I recommend turning on Auto Keying for this. Like before, fine-tune by visual comparison while toggling b
ack and forth between those 2 frames. When that’s done, don’t forget to turn off Auto Keying. Now the Ragdoll end position blends to the getting up Action. The blend is too fast so we’ll need to move that last keyframe. That looks better. Using this technique, we can create many seamless animations with ‘virtual stunts’. One last tip, if you run into these kinds of shenannigans where the Ragdoll explodes all over the place when you move it, One thing you can do is just temporarily remove the Rig
id Body World. Then you can move the Ragdoll, and add the Rigid Body World back when you’re done. Check my Mocap Playlist for more motion capture related videos, or click the link to go to my website and download the ragdoll file.

Comments

@6TheBACH

KILLER BEAN 3 HERE I COME

@mb0133

this was extremely informative, especially on the graph editor in regards to fixing the arms clipping for armature skeletal proportions and remapped rig body proportions.

@tajaloe5920

This is something that you might find valuable learning to do in a game engine, anim-physics blending is quite straightforward

@molecularcgi

I figured out a way to do this molecular particle ragdolls, for example break of the characters head and have the body get up and go look for the head. Pretty excited, will share this concept soon!

@Raddius

Can you please make a video on how to combine the ocean modifier and a fluid simulation (flip fluids preferably but Mantaflow is okay too) I can’t find any other tutorials on it that’s not 10 hours long or in an extremely outdated version of blender.

@Nortic111

Late congratulations on the 200k subs!

@Rey--_--

This is the best video broo

@ronidude

how do i make the ragdoll not collapse on the 1st frame i want it to do an action on the 30th framer but i cant because it collapses on the 1st

@pile333

Very interesting. Well done. What if we'd like to simulate bone fractures; would it be enough to subdivide rigged bones? How to pivoting the unnatural poses of a falling body that bumps into objects (that realist effect is very rare in motion picture industry and still today it shows when a scene is made totally in 3D).

@salmanramezani4784

it was good toturial but IDK why you dont use chat-GPT to maje a code for you to copy your empty animation for bones it will so fast and help a lot . sometimes I use a code to do what I need even I dont know anything about python but it works fine

@IAmPancake

Okay, this is probably a really cheap workaround, but could you have 2 identical versions of the ragdolled character, one set up for animation and one for physics, then replace one with the other in the same pose any time you want to switch between phys/anim? It seems like it would work

@demian5631

Instead of manually animating the character to conform to the ragdoll, it might just be quicker to add bones to the doll which are the children (child-of constraint) of the colliders, the baking the animation for each of the bones and then retargeting it onto the main rig.

@whenyouarebored

That was cool, I clicked on the link to your website for the ragdoll but it says it isn't up? This was a very well made video!

@hasanhuseyindincer5334

👏👏👍👍

@pile333

Are you getting into videogames now?

@guyjinpop

it seems like a hassle doing the match move rekeying again once you baked the rag doll physics. I saw this add-on. perhaps it may help? https://www.youtube.com/watch?v=lobKcsbQqSY&t=9s

@pragashtrincomalee934

display letters too small please consider laptop users 😥

@jamaljamalwaziat1002

In houdini is hard in blender is impossible

@ltraltier6009

im sick of mixamo being shilled when it refuses to rig my simple character model.