[Bf-taskforce25] Python API: naming suggestion

Eric Begue ericbeg at gmail.com
Thu Jul 9 11:37:15 CEST 2009


Hi Arystan,

So, my message were finally in the right place since Python API is part 
of 2.5 project. =P

BTW.

To keep the members name short and to suppress the confusion, I would 
add a new member method named 'Bone.set_relative_space' which take the 
name of the desired space as parameter. It will act like a switch for 
selecting the relative space of Bone.matrix, Bone.head, etc. So the 
values returned by those methods depends on  the selected space.

The name of the relative spaces would be:
'ARMATURESPACE' : relative to the armature (default).
'BONESPACE': relative the bone itself. This space is the local space of 
the bone where the head is at (0, 0, 0) and tail is along the Y axis.
'PARENTSPACE': relative the parent head.
'PARENTTAILSPACE': relative the parent tail.

What do you think about ?

Eric

Arystan Dyussenov wrote:
> Hi Eric,
>
> I'm a student working on import/export part of the new Python API for 
> Blender 2.5 as a Google Summer of Code project. Accidentally, I'm 
> working on the armature section at the moment.
>
> The new API is closely related to the system called RNA which allows 
> for smaller Python API code making it easier to maintain.
>
> In the new API, 'BONESPACE' and 'ARMATURESPACE' are separated into 
> distinct members, for example, bone.matrix['BONESPACE'] is simply 
> bone.matrix in 2.5 and bone.matrix['ARMATURESPACE'] is 
> bone.armature_matrix, etc. The same applies to head and tail vectors.
>
> Although bone.armature_matrix may sound confusing too, maybe name it 
> bone.armature_relative_matrix?
>
> Arystan
>
> On Wed, Jul 8, 2009 at 11:52 PM, Eric Begue <ericbeg at gmail.com 
> <mailto:ericbeg at gmail.com>> wrote:
>
>     Hello,
>
>     This is not related to the 2.5 project, sorry for that, but I
>     don't know
>     where to post such message. Please tell if there is a "suggestions
>     box"
>     somewhere, so I will write there the next time.
>
>     I would like to suggest a renaming of the 'BONESPACE' dictionary entry
>     for data such as Bone.head, or Bone.matrix in the Python API. I
>     think it
>     would be more explicit to rename it to 'PARENTSPACE'.
>
>     'BONESPACE' evokes the bone local space coordinate, it is not.
>
>     In the API documentation one can read:
>     " 'BONESPACE' - the head position in relation to itself."
>
>     I found this description very confusing. Because the head position is
>     always at (0,0,0) in the bone local space.
>
>     I would write this description as followed:
>
>     " 'PARENTSPACE' - the head position in relation to its parent tail"
>
>     Thanks,
>     Eric
>     _______________________________________________
>     Bf-taskforce25 mailing list
>     Bf-taskforce25 at blender.org <mailto:Bf-taskforce25 at blender.org>
>     http://lists.blender.org/mailman/listinfo/bf-taskforce25
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bf-taskforce25 mailing list
> Bf-taskforce25 at blender.org
> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>   



More information about the Bf-taskforce25 mailing list