From 92c47145fde8449cd7fb0547d29dbf9491b40d97 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Feb 2012 16:08:30 +0000 Subject: bmesh python api change in internal behavior. * Only have 1 python object per bmesh, vertex, edge, loop, face. * Store pointers back to the python data in a custom data layer so as not to use more memory for normal editing operations (when pythons not running). * Currently this data is created and freed along with the BMesh PyObject. * Incidentally - this fixes comparisons for bmesh elements which wasnt working before. --- source/blender/makesdna/DNA_customdata_types.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna/DNA_customdata_types.h') diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index f7f40e99617..d7358a4df1e 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -63,10 +63,9 @@ typedef struct CustomDataExternal { * layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */ typedef struct CustomData { CustomDataLayer *layers; /* CustomDataLayers, ordered by type */ - int typemap[33]; /* runtime only! - maps types to indices of first layer of that type, + int typemap[34]; /* runtime only! - maps types to indices of first layer of that type, * MUST be >= CD_NUMTYPES, but we cant use a define here. * Correct size is ensured in CustomData_update_typemap assert() */ - int pad1; int totlayer, maxlayer; /* number of layers, size of layers array */ int totsize, pad2; /* in editmode, total size of all data layers */ @@ -110,9 +109,10 @@ typedef struct CustomData { #define CD_CREASE 30 #define CD_ORIGSPACE_MLOOP 31 #define CD_WEIGHT_MLOOPCOL 32 +#define CD_BM_ELEM_PYPTR 33 /* BMESH ONLY END */ -#define CD_NUMTYPES 33 +#define CD_NUMTYPES 34 /* Bits for CustomDataMask */ #define CD_MASK_MVERT (1 << CD_MVERT) @@ -148,6 +148,7 @@ typedef struct CustomData { #define CD_MASK_CREASE (1 << CD_CREASE) #define CD_MASK_ORIGSPACE_MLOOP (1 << CD_ORIGSPACE_MLOOP) #define CD_MASK_WEIGHT_MLOOPCOL (1LL << CD_WEIGHT_MLOOPCOL) +#define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR) /* BMESH ONLY END */ /* CustomData.flag */ -- cgit v1.2.3