[Bf-committers] Question about bone allocation (Chicken or the egg)

Tobias Oelgarte tobias.oelgarte at googlemail.com
Tue Feb 1 15:13:02 CET 2011

Im currently reviewing the armature code to fix the loss of precession 
while switching between edit mode and pose mode. Basically the locations 
and roll angles are computed back and forth every time. Since it is done 
with floating point precession the rig tends to fall apart. To correct 
that i will have to know how the "Bone struct" is allocated. Does it 
even get allocated? Meaning that it will always be the result from a 
conversion from "struct EditBone" to "struct Bone"?

The question is basically about the fact which kind of struct is created 
first. From using blender i would assume that Editbones get created 
first and will then be converted to Bones, when you leave editmode. On 
the other hand: How it is handled while loading an existing file? Are 
the Editbones (for editmode) stored or the Bones (for Posemode and 
anything else)?

What i basically want to do is to store the untransformed head and tail 
locations together with the boneroll as separate variables inside the 
"Bone struct". That seams to me the only way to get rid of the steady 
conversions, which will end up destroying the bone locations in editmode.

Tobias Oelgarte

More information about the Bf-committers mailing list