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

Tobias Oelgarte tobias.oelgarte at googlemail.com
Tue Feb 1 16:18:30 CET 2011

I don't know. Maybe it is easier to write code for the positioning of 
the bones in edit-mode and it wastes less space while storing. The real 
issue behind this is the steady conversion between this two types of 
structs. Everytime it will compute the boneroll, head and tail again as 
you enter edit-mode. A first more simple fix would be store this three 
properties along with Bone struct. (It has the same variable names, but 
they store different values) If i would add this three additional 
variables (float e_roll, float e_head[3], float e_tail[3]) then they 
could simply be copied back. This would at least result in no loss of 

The more general approach would be to make no difference and use one 
struct for both of them. This will store a bunch of extra information, 
but seriously, how many bones do you use? May it 1000 bones, then its 
still less then any normal sized texture.

But it still does not answer my main question. Is any "Bone Object" 
allocated somewhere before it's corresponding "EditBone Object"?

If not, then it would be easy to implement the three additional 
variables. The recomputation of roll, head and tail could be omitted 
while switching from pose- to edit-mode. The next step then could be to 
get rid of the EditBone-struct and the needles conversations, copying of 

Am 01.02.2011 16:00, schrieb Tom Edwards:
> Why are heads and tails stored anyway? This would be a great opportunity
> to make editbones loc, rot, length. The difference between edit and pose
> is bizarre from both a user's and developer's perspective, and a huge
> HUGE headache when importing/exporting.
> On 01/02/2011 2:13, Tobias Oelgarte wrote:
>> 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
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list