I was testing flex and found an interesting way to rig a animatable softbody skeletal mesh. I already mentioned it a bit here already. Rather than standard skinning, this method is more like taking a rubber model and putting a metal armature inside. Some reasons why you might want to try this is as follows.
The soft body will animate to create a jiggle effect and applies self collision e.g middle image shows fat being moved due to raised leg.
Another example of self collision is the fold on the arm on the right image (looks better when animated). It also maintains volume so it creates muscle like effects and it’s easier to model complex areas like the shoulders and hip without extra helper bones.
It was easier to setup than skinning. The image above shows the shapes used (can ignore the spheres, empty objects). It’s probably hard to see but the pelvis is a cube rotated by 45 degrees on two axis.
This character should also interact with other flex objects like water and cloth (but I have had some issues).
For this tutorial I used the flex sample project and the SK_Troll_Poison model from the free “Infinity Blade: Adversaries” assets. The model is low poly (~2,300 triangles) and demonstrates bulky muscle areas and fat.
To create the softbody export the SK_Troll_Poison model as fbx. I exported it from the animation editor, then opened it in blender, removed the rig, scaled it down to 1% and exported it as an fbx. Make sure the imported static mesh is the same size as the skeletal mesh.
Convert the static mesh to a flex soft body using the flexSoftContainer container (described in sample project docs). Make sure to include “Attach to Rigids” and “Phase/Self Collide”. Create a scene containing the soft body and skeletal mesh at the same location. Also watch out of any existing collisions e.g move the player start out of the way. I based the material on the flexBaconMat. Check to make sure that the soft body falls correctly.
Do the following for each bone you want to map. Create an empty actor and name it the same as the bone and tick “Actor hidden in game”. Then drag and drop in on to SK_Troll_Poison. Select the matching bone to attach it to. Change to local space and add shapes to each bone actor. Move the shapes to get something that looks like the earlier shapes image. Just a rough layout will probably be fine. The belly has no shape overlapping it so it jiggles. Make sure that “Visible” and “Actor hidden in game” are both unchecked on the SK_Troll_Poison.
Testing the rig.
Setup the above right image structure. Run the game and try rotating each bone.
Animating the rig.
Setup the above left image structure. Run the game and change “Animation mode” to “Use animation asset” on SK_Troll_Poison. Tick “Visible” then “Actor hidden in game” on the SK_Troll_Poison. Try changing the animations. Avoid setting the animation when editing or it could lose the default pose. The default pose is required at the start to bind the soft body to the shapes.
I changed the soft body cluster radius from 30 to 20 to improve raising the arm.
Most animations look like the image on the left. If the character intersects itself then it can appear like the right image (fixes itself when the next animation starts). The right image was from the attack overhead animation.