I have a hair rig with a lot of bone chains in a single armature. The bone chains are curved in their rest pose, matching the hair curving down around the character's head. I want to straighten out all the bone chains and save it as a new pose. The problem is that rest pose is already seen as 0,0,0 for rotation. How can I straighten these bone chains?
Script to align child edit bones to the selected edit bone. (The base of hair bones) To use: have your rig in edit mode, and the desired base bone(s) of hair bone chains selected.. As with all scripts save first.
import bpy context = bpy.context for eb in context.selected_editable_bones: parent = eb v = (eb.tail - eb.head).normalized() while len(parent.children): bone = parent.children bone.head = parent.tail bone.tail = parent.tail + bone.length * v parent = bone
One option to do that would be to use Auto IK, which is located in 3D Viewport > Toolshelf > Options tab (use T to toggle open/close the Toolshelf). When Auto IK is turned on, you can select last bone of the chain and pull it straight to any direction you want.
Alternatively (necessary if your hair chains are directly connected to head), you could use IK Solvers. In Pose Mode, select the last bone of the chain, key Shift + I, select To New Empty, and in the Properties panel > Bone Constraints tab, set the chain length to the right amount of bones. Then, you can use the empty object created earlier to pull the chain straight.
To align bones regardless of parenting you can temporarily add a
copy rotation constraint for each bone, then apply the visual transform by selecting the bone and clicking
Apply visual transform to pose and
CTRL+A again >
Apply pose as rest posefor it to take effect in the edit mode as well, then you can delete the
copy rotation constraint.