[Bf-python] extended keyable types

Campbell Barton cbarton at metavr.com
Thu Jul 26 14:19:56 CEST 2007


Hi, Iv updated the section on extended keyable types as well as written 
in support to the pydevel-api...
http://wiki.blender.org/index.php/Rewriting_the_2.4x_BPython_API#Extended_Keyable_Settings

Heares the source for the subtype of PyFloat called BPyFloat, take a 
look at the implimentation.
http://projects.blender.org/plugins/scmsvn/viewcvs.php/branches/pyapi_devel/source/blender/python/api2_2x/bpy_float.c?root=bf-blender&view=markup
http://projects.blender.org/plugins/scmsvn/viewcvs.php/branches/pyapi_devel/source/blender/python/api2_2x/bpy_float.h?root=bf-blender&view=markup

I also think this should be available in other types that can be key. 
vectors, eulers, quats, color.

All these types maintain a link to their data origin so they have 
all/most of what they would need to insert a keyframe into that data.

so for example
    lamp.insertIpoKey(Lamp.COLOR)

could be
    lamp.color.keyframe()
    ob.loc.keyframe()
    bone.quat.keyframe()
    ob.layers.keyframe()

This could of course work with...
    ob.loc.x.keyframe()

etc.

object
Of course for non keyable vectors, colors etc this would raise an error 
"This Vector is not linked to keyable data"


If this is OK, we can remove all data.insertIpoKey() func's and just 
have keyframe() as an attribute. This seems like a much neater way to 
manage adding keyframes to me. no looking up docs for lists of constants.


PS- In the last mail I mentioned people who's opinions Id like regarding 
small-lists, I forgot to add Theeth to that list ;)




More information about the Bf-python mailing list