Talk:Blender: Difference between revisions

Line 91: Line 91:


==Reorienting the bone axes according to UE4's conventions==
==Reorienting the bone axes according to UE4's conventions==
The model so far can have some imperfections that we may want to fix (leftover symmetry issues, mesh layout that was messed up a bit when we scaled the bones, too much detail for the underwear, chest size, weight mapping of the breasts) but for now we just want to export this model so that it can be used in UE4. It is already in the exact same A-pose as the UE4 mannequin, but the bones ''orientations'' do not agree with UE4's conventions. (That's perhaps the least intuitive part: the bones of UE4 skeleton do not have Y as their main axis, whereas Blender's bones are always along Y.)
The model so far can have some imperfections that we may want to fix (leftover symmetry issues, mesh layout that was messed up a bit when we scaled the bones, too much detail for the underwear, chest size, weight mapping of the breasts) but for now we just want to export this model so that it can be used in UE4. It is already in the exact same A-pose as the UE4 mannequin, but the bones' ''orientations'' do not agree with UE4's conventions. (That's perhaps the least intuitive part: the bones of UE4 skeleton do not have Y as their main axis, whereas Blender's bones are always along Y.)


For the record, here is an FBX with the mannequin's bones as they are supposed to be: http://geyser.oni2.net/UE4/LaraTutorial/SK_Mannequin.FBX
For reference, here is an FBX with the mannequin's bones as they are supposed to be: http://geyser.oni2.net/UE4/LaraTutorial/SK_Mannequin.FBX


Unless you have an automated way for rotating bones exactly by 90° in exactly the right direction depending on the bone, this needs to be done manually. There are at least two ways to do this in Blender.
Unless you have an automated way for rotating bones exactly by 90° in exactly the right direction depending on the bone, this needs to be done manually. There are at least two ways to do this in Blender.
Line 107: Line 107:


===In-place bone rotation===
===In-place bone rotation===
Blender's implementation of bones is not the most intuitive, but it turns out there is a way to rotate bones in Edit mode. This is allowed by selecting "Normal" as the rotation mode (as opposed to "Gimbal", "Global" and "Local") and setting "Individual origins" as "Pivot center for rotation/scaling". Only sideways rotations of the bone can be done that way, though; rotation around the bone's own axis must be done by incrementing the bone's "roll" value. Also, before you rotate a bones, you must disconnect any child bones, otherwise the rotation of the bone will affect them.
Blender's implementation of bones is not the most intuitive, but it turns out there is a way to rotate bones in Edit mode. This is allowed by selecting "Normal" as the rotation mode (as opposed to "Gimbal", "Global" and "Local") and setting "Individual origins" as "Pivot center for rotation/scaling". Only sideways rotations of the bone can be done that way, though; rotation around the bone's own axis must be done by incrementing the bone's "roll" value. Also, before you rotate a bone, you must disconnect any child bones, otherwise the rotation of the bone will affect them.


The rotations that need to be applied to the bones (in Edit mode, disconnected, in "Normal" rotation mode, with "Individual origins" as pivot center) are as follows:
The rotations that need to be applied to the bones (in Edit mode, disconnected, in "Normal" rotation mode, with "Individual origins" as pivot center) are as follows:
Line 121: Line 121:
After renaming all the bones in consistence with UE4's rig it looks like this: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7renamed.blend
After renaming all the bones in consistence with UE4's rig it looks like this: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7renamed.blend


After adding the extra IK bones (copies of the hand and foot bones), parenting them properly, and removing the leaf bones, it looks like this: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7tree.blend
After adding the extra IK bones (a couple of root bones, and some copies of the hand and foot bones), parenting them properly, and removing the leaf bones, it looks like this: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7tree.blend


Finally we just need to check the transformations of all the object (zero translations/rotations and unit scales for everything, except the top-level empty which must have scale 0.01 for the unit change).
Finally we just need to check the transformations of all the object (zero translations/rotations and unit scales for everything, except the top-level empty which must have scale 0.01 for the unit change).
Line 127: Line 127:


The exported FBX is here: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7export.fbx
The exported FBX is here: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7export.fbx
The same FBX with the textures extracted rather than enmbedded is here: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7export.zip
The same FBX with the textures extracted rather than embedded is here: http://geyser.oni2.net/UE4/LaraTutorial/LaraStep7export.zip