I am trying to understand how exactly parented bones are rotated in blender.
Consider the following hierarchy: Bone1 -> Bone2 -> Bone3 -> Bone4 -> Bone5
If i were to rotate Bone2, how will blender rotate it & it's children bones(Bone3, Bone4, Bone5)? I'd assume that Blender does the following:
- Set pivot point of Bone2 to the bones local position, Rotate Bone2
- Set pivot point of Bone3 to (Bone2.localPos + Bone3.localPos) Rotate Bone3
- Set pivot point of Bone4 to (Bone2.localPos + Bone3.localPos + Bone4.localPos) Rotate bone4
- Set pivot point of Bone5 to (Bone2.localPos + Bone3.localPos + Bone4.localPos + Bone5.localPos) rotate bone5
And from what i understand the local position of a bone is calculated the following way:
Bone.localPos = Bone.pos - Bone.parent.pos
If the bone has no parent then it's just the bones position
An example with actual position values:
Now even more explicitly:
Assume that the bones have the following global positions:
Bone1: (50, 20, -25)
Bone2: (35, -15, 20)
Bone3: (-10, -20, 50)
Bone4: (-35, 20, 40)
Bone5: (15, 25, 10)
The local positions would be:
Bone1Local = (50, 20, -25)
Bone2Local = (-15, -35, 45)
Bone3Local = (-45, -5, 30)
Bone4Local = (-25, 40, -10)
Bone5Local = (50, 5, -30)
The pivot points when Bone2 is rotated would be the following:
Bone2: (-15, -35, 45) // bone2Local
Bone3: (-60, -40, 75) // bone2Local + bone3Local
Bone4: (-85, 0, 65) // bone2Local + bone3Local + bone4Local
Bone5: (-35, 5, 35) // bone2Local + bone3Local + bone4Local + bone5Local
If this is not how blender rotates bones, an explanation how it actually works would be much appreciated, if it is please just confirm that my understanding of it is correct :)