[Bf-python] generic ID struct access

Ken Hughes khughes at pacific.edu
Tue Aug 22 21:10:04 CEST 2006


Something else Cam and I discussed this morning in IRC:

Instead of replicating all the getsetters which access ID structures in 
Blender objects (.name, .user, etc), it should be pretty easy to make 
set of "generic" getsetters for them.  I've verified that this would 
work by having Mesh and Object share the same getseters.  As far as I 
can see, the only requirement would be that the BPyType declaration 
would need to declare the pointer to the Blender object right after the 
dummy HEAD object, i.e.:

typedef struct {
     PyObject_HEAD
     struct Object *object;
} BPy_Object;

This is something that could be implemented for new BPy types and later 
worked back into existing types as we refactor the API.

Ken



More information about the Bf-python mailing list