Hey all.
Everyone always asks the horrible question…
Can I rig my character with this? The answer is finally YES.
Tried and true, very cumbersome method is as follows.
-
Make your starting mesh, UVit, texture it. do all the basic stuff you are required to do.
-
Open Blender, Import SK Mannequin, Generate Metarig only.
-
Copy metarig to a new one - we need to merge up some bones onto the mannequin for good measure.
In Edit mode, remove every bone except Breast.L, Breast.R, Pelvis.L, Pelvis.R, The Face bone and all it’s children.
Optionally create your toes? This can be a lengthy manual process, but if you need toes you do need to make them.
-
Drop out into object mode. You should have the modified Metarig selected. Select the ROOT armature and CTRL+J to merge the 2.
-
Make sure to correctly parent the Breast, and the Pelvis, as well as the Face and any toes.
Breast go to Spine_03, Pelvies 2 pelvis, and Face to Head.
At this point you have a basic skeleton that resembles the UE4 one, but has a few extras. Here’s a screenshot as an example - Pink bones are the Extras.
Step 6
With the Meta-rig Selected, Generate your rig through the skeletal tab/regular Rigify button.
After it’s done, you get your nice little rig that doesn’t move anything at all.
Step 7
Take your mesh you need to rig, Parent it to the rig with empty weights.
This is the “magic” basically. The rig does a better job painting weights then a human with little experience doing it manually.
Step 8
You have your mesh, it’s got it’s ton of vertex groups and it deforms correctly with the rig - Don’t animate yet. this is the starting point to actually get things into UE4 with the right skeletal mesh.
Click the mesh, and Unapparent it from the rig armor.
Step 9
Parent the mesh to the Root armor - select only Armature deform.
Step 10
Right now it’s a mess. the bone names for the vertex groups are all screwed up. No worries.
you can try to run this script:
import bpy
OriginalBones="spine_01","spine_02","spine_03","head","teeth.T","teeth.B","teeth.B","forehead.R","forehead.L.001","forehead.R.001","forehead.L.002","forehead.R.002","temple.L","temple.R","brow.B.L","brow.B.L.001","brow.B.L.002","brow.B.L.003","lid.B.L","lid.B.L.001","lid.B.L.002","lid.B.L.003","lid.T.L","lid.T.L.001","lid.T.L.002","lid.T.L.003","eye.L","eye.R","lid.B.R","lid.B.R.001","lid.B.R.002","lid.B.R.003","lid.T.R","lid.T.R.001","lid.T.R.002","lid.T.R.003","brow.B.R","brow.B.R.001","brow.B.R.002","brow.B.R.003","chin","chin.001","chin.L","chin.R","brow.T.L","brow.T.L.001","brow.T.L.002","brow.T.L.003","jaw","jaw.L","jaw.L.001","jaw.R","jaw.R.001","brow.T.R","brow.T.R.001","brow.T.R.002","brow.T.R.003","cheek.T.L","cheek.T.L.001","cheek.T.R","cheek.T.R.001","cheek.B.L","cheek.B.L.001","cheek.B.R","cheek.B.R.001","tongue","tongue.001","tongue.002","ear.L","ear.L.001","ear.L.002","ear.L.003","ear.L.004","ear.R","ear.R.001","ear.R.002","ear.R.003","ear.R.004","nose","nose.001","nose.002","nose.003","nose.004","nose.R","nose.R.001","nose.L","nose.L.001","lip.T.L","lip.T.L.001","lip.T.R","lip.T.R.001","lip.B.L","lip.B.L.001","lip.B.R","lip.B.R.001","toe.01.L.01","toe.01.L.02","toe.01.L.03","toe.02.L.01","toe.02.L.02","toe.02.L.03","toe03.L.01","toe03.L.02","toe03.L.03","toe.04.L.01","toe.04.L.02","toe.04.L.03","toe.05.L.01","toe.05.L.02","toe.05.L.03","toe.01.R.01","toe.01.R.02","toe.01.R.03","toe.02.R.01","toe.02.R.02","toe.02.R.03","toe03.R.01","toe03.R.02","toe03.R.03","toe.04.R.01","toe.04.R.02","toe.04.R.03","toe.05.R.01","toe.05.R.02","toe.05.R.03","thumb_01_l","thumb_02_l","thumb_03_l","index_01_l","index_02_l","index_03_l","middle_01_l","middle_02_l","middle_03_l","ring_01_l","ring_02_l","ring_03_l","pinky_01_l","pinky_02_l","pinky_03_l","thumb_01_r","thumb_02_r","thumb_03_r","index_01_r","index_02_r","index_03_r","middle_01_r","middle_02_r","middle_03_r","ring_01_r","ring_02_r","ring_03_r","pinky_01_r","pinky_02_r","pinky_03_r","thigh_l","thigh_twist_01_l","calf_l","calf_twist_01_l","foot_l","ball_l","thigh_r","thigh_twist_01_r","calf_r","calf_twist_01_r","foot_r","ball_r","clavicle_l","upperarm_l","upperarm_twist_01_l","lowerarm_l","lowerarm_twist_01_l","hand_l","clavicle_r","upperarm_r","upperarm_twist_01_r","lowerarm_r","lowerarm_twist_01_r","hand_r","breast.L","breast.R"]
CorrespondingBones="DEF-spine.001","DEF-spine.002","DEF-spine.003","DEF-spine.006","ORG-teeth.T","ORG-teeth.B","DEF-forehead.L","DEF-forehead.R","DEF-forehead.L.001","DEF-forehead.R.001","DEF-forehead.L.002","DEF-forehead.R.002","DEF-temple.L","DEF-temple.R","DEF-brow.B.L","DEF-brow.B.L.001","DEF-brow.B.L.002","DEF-brow.B.L.003","DEF-lid.B.L","DEF-lid.B.L.001","DEF-lid.B.L.002","DEF-lid.B.L.003","DEF-lid.T.L","DEF-lid.T.L.001","DEF-lid.T.L.002","DEF-lid.T.L.003","MCH-eye.L","MCH-eye.R","DEF-lid.B.R","DEF-lid.B.R.001","DEF-lid.B.R.002","DEF-lid.B.R.003","DEF-lid.T.R","DEF-lid.T.R.001","DEF-lid.T.R.002","DEF-lid.T.R.003","DEF-brow.B.R","DEF-brow.B.R.001","DEF-brow.B.R.002","DEF-brow.B.R.003","DEF-chin","DEF-chin.001","DEF-chin.L","DEF-chin.R","DEF-brow.T.L","DEF-brow.T.L.001","DEF-brow.T.L.002","DEF-brow.T.L.003","DEF-jaw","DEF-jaw.L","DEF-jaw.L.001","DEF-jaw.R","DEF-jaw.R.001","DEF-brow.T.R","DEF-brow.T.R.001","DEF-brow.T.R.002","DEF-brow.T.R.003","DEF-cheek.T.L","DEF-cheek.T.L.001","DEF-cheek.T.R","DEF-cheek.T.R.001","DEF-cheek.B.L","DEF-cheek.B.L.001","DEF-cheek.B.R","DEF-cheek.B.R.001","DEF-tongue","DEF-tongue.001","DEF-tongue.002","DEF-ear.L","DEF-ear.L.001","DEF-ear.L.002","DEF-ear.L.003","DEF-ear.L.004","DEF-ear.R","DEF-ear.R.001","DEF-ear.R.002","DEF-ear.R.003","DEF-ear.R.004","DEF-nose","DEF-nose.001","DEF-nose.002","DEF-nose.003","DEF-nose.004","DEF-nose.R","DEF-nose.R.001","DEF-nose.L","DEF-nose.L.001","DEF-lip.T.L","DEF-lip.T.L.001","DEF-lip.T.R","DEF-lip.T.R.001","DEF-lip.B.L","DEF-lip.B.L.001","DEF-lip.B.R","DEF-lip.B.R.001","DEF-f_toe.01.L.01","DEF-f_toe.01.L.02","DEF-f_toe.01.L.03","DEF-f_toe.02.L.01","DEF-f_toe.02.L.02","DEF-f_toe.02.L.03","DEF-f_toe.03.L.01","DEF-f_toe.03.L.02","DEF-f_toe.03.L.03","DEF-f_toe.04.L.01","DEF-f_toe.04.L.02","DEF-f_toe.04.L.03","DEF-f_toe.05.L.01","DEF-f_toe.05.L.02","DEF-f_toe.05.L.03","DEF-f_toe.01.R.01","DEF-f_toe.01.R.02","DEF-f_toe.01.R.03","DEF-f_toe.02.R.01","DEF-f_toe.02.R.02","DEF-f_toe.02.R.03","DEF-f_toe.03.R.01","DEF-f_toe.03.R.02","DEF-f_toe.03.R.03","DEF-f_toe.04.R.01","DEF-f_toe.04.R.02","DEF-f_toe.04.R.03","DEF-f_toe.05.R.01","DEF-f_toe.05.R.02","DEF-f_toe.05.R.03","DEF-thumb.01.L","DEF-thumb.02.L","DEF-thumb.03.L","DEF-f_index.01.L","DEF-f_index.02.L","DEF-f_index.03.L","DEF-f_middle.01.L","DEF-f_middle.02.L","DEF-f_middle.03.L","DEF-f_ring.01.L","DEF-f_ring.02.L","DEF-f_ring.03.L","DEF-f_pinky.01.L","DEF-f_pinky.02.L","DEF-f_pinky.03.L","DEF-thumb.01.R","DEF-thumb.02.R","DEF-thumb.03.R","DEF-f_index.01.R","DEF-f_index.02.R","DEF-f_index.03.R","DEF-f_middle.01.R","DEF-f_middle.02.R","DEF-f_middle.03.R","DEF-f_ring.01.R","DEF-f_ring.02.R","DEF-f_ring.03.R","DEF-f_pinky.01.R","DEF-f_pinky.02.R","DEF-f_pinky.03.R","DEF-thigh.L","DEF-thigh.L.001","DEF-shin.L","DEF-shin.L.001","DEF-foot.L","DEF-toe.L","DEF-thigh.R","DEF-thigh.R.001","DEF-shin.R","DEF-shin.R.001","DEF-foot.R","DEF-toe.R","DEF-shoulder.L","DEF-upper_arm.L","DEF-upper_arm.L.001","DEF-forearm.L","DEF-forearm.L.001","DEF-hand.L","DEF-shoulder.R","DEF-upper_arm.R","DEF-upper_arm.R.001","DEF-forearm.R","DEF-forearm.R.001","DEF-hand.R","DEF-breast.L","DEF-breast.R"]
#first, let's rename all the known bones correctly.
for index, bone in enumerate(CorrespondingBones):
if bpy.data.objects'Sk_Mannequin.000'].vertex_groups.get(bone) is not None:
bone = bpy.data.objects'Sk_Mannequin.000'].vertex_groups.get(bone)
print(bone.name)
bone.name = OriginalBones[index]
What does it do? It goes through all the mesh vertex groups and renames them to what they SHOULD be - based on the starting mannequin.
This makes it so that the UE4 bones actually have the same weight as the rig - and therefore somewhat cleaner animations.
Step 11
Merging extra weights.
Blender has a special tool to merge/mix weight paint. You want to use this in a few cases for the leftover DEF- vertex groups.
This is usually a “done by hand” process that’s a bit tedious, but important.
The bone you will certainly have issues with the is the neck.
The metarig/rig use 2 bones for the neck, UE4 only has one. As a result you will need to merge/add the weight paint from Spine 04 to Spine 05 and rename them to Neck_01
Here is a screenshot of how you want the modifier setup. Pro tip, you can leave the Vertex Group A selected in WeightPaint mode and as you make changes to the modifier you will see what all the different options do
For grp a make sure you select DEF-Spine.005 for grp B select DEF-Spine.006
Once you apply that you can rename DEF-Spine.005 to Neck_01
Once all the extra weights are merged you should get a complete custom mesh that exactly follows the mannequin so…
Step 12:
Select the root, Select the mesh - click the export button.
You are just exporting the FBX, the currently live plugin is missing the edges and faces button included in the screenshot above.
Make sure to check the Only Selected (you don’t want the metarig or the rig exported).
You don’t even need to check “only deforms”, as what we have is the right rig with just a few extra bones.
Step 13:
Import to UE4 - same settings as always. maybe generate the PHAT. don’t select a skeleton you want to generate it.
Step 14
Open Persona and get to the Skeleton. Set up re-targeting.
Select the drop down, click humanoid, and auto map. Set the base pose. create a custom mesh above that. Save the skeleton.
Step 15
Re target a UE4 animation to test. go with something crouching or jumping. you need a complex animation so you can weed out issues.
COMMON ISSUES:
My shoulders are deformed!? yes. very likely. I think the script above has the twist and the shoulder order inverted. It’s easy enough to rename the vertex groups on these manually.
Some stuff isn’t moving?
That’s expected. None of the steps above told you to delete all of the remaining DEF- bones - on purpose. You need to see which have to be merged together and how. the only way is to keep on re-importing the base mesh and looking at the changes within the same re-targeted animation.
Some stuff looks just wrong?
Yep, that’s the weight paint. Not even the automated system is perfect. You might need to adjust things. Definitely because of the extra bones some things may be off and need re-adjusting.
Luckly, you have all the parts to set up the BoneBreaker rig and fix it up. You just need to follow the nomenclature and structure of a working bone breaker rig - and then you can Generate Rig from the Meta-rig, or import the UE4 re-targeted animations and generate from that to adjust.
A proper port of this method will be scripted and included in future release with some buttons and features that allow to make this 15 steps of a mess into something a little more manageable.
Currently, the biggest “odd” area is the thigh-to-hip zone.
And the neck area.
Both of these are possibly best handled by modifying an export of the re-targeted animation.