Use python subtypes so bpy.types.Mesh is a subtype of bpy.types.ID

This means checks like this work.
 isinstance(bpy.data.meshes[0], bpy.types.ID)
 
 bpy.types.Mesh.__base__ == bpy.types.ID
This commit is contained in:
2009-07-10 18:09:53 +00:00
parent b3d6b2f728
commit 64f300ccf4
2 changed files with 31 additions and 23 deletions

View File

@@ -85,6 +85,13 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps);
#endif
typedef struct Mathutils_Callback Mathutils_Callback;
typedef int (*BaseMathCheckFunc)(PyObject *);
typedef int (*BaseMathGetFunc)(PyObject *, int, float *);
typedef int (*BaseMathSetFunc)(PyObject *, int, float *);
typedef int (*BaseMathGetIndexFunc)(PyObject *, int, float *, int);
typedef int (*BaseMathSetIndexFunc)(PyObject *, int, float *, int);
struct Mathutils_Callback {
int (*check)(PyObject *user); /* checks the user is still valid */
int (*get)(PyObject *user, int subtype, float *from); /* gets the vector from the user */