diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-02-21 05:40:04 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-02-21 05:40:04 +0400 |
commit | 69289c978eace478bf992517473960d540895815 (patch) | |
tree | 493d2c9bec32f761468b082fbbb015c748b71685 /source/blender/makesdna | |
parent | 5f093d6a5867a365900158fcca71296852787aac (diff) | |
parent | be674afdadaa1ab966147755e224e8bbda6807db (diff) |
Merged changes in the trunk up to revision 44266 (including BMesh).
Freestyle edge/face marks were ported to BMesh.
Conflicts resolved:
source/blender/editors/mesh/editface.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_meshdata_types.h
source/blender/blenkernel/intern/editderivedmesh.c
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 28 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_defs.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_key_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 22 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 46 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_vec_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/intern/SConscript | 2 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 3 |
9 files changed, 79 insertions, 45 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index eeeb0581527..f7f40e99617 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -47,7 +47,7 @@ typedef struct CustomDataLayer { int active_rnd; /* number of the layer to render*/ int active_clone; /* number of the layer to render*/ int active_mask; /* number of the layer to render*/ - char pad[4]; + int uid; /* shape keyblock unique id reference*/ char name[64]; /* layer name, MAX_CUSTOMDATA_LAYER_AAME */ void *data; /* layer data */ } CustomDataLayer; @@ -63,11 +63,13 @@ 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[32]; /* runtime only! - maps types to indices of first layer of that type, + int typemap[33]; /* 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, pad; /* in editmode, total size of all data layers */ + int totsize, pad2; /* in editmode, total size of all data layers */ void *pool; /* Bmesh: Memory pool for allocation of blocks */ CustomDataExternal *external; /* external file storing customdata layers */ } CustomData; @@ -99,8 +101,6 @@ typedef struct CustomData { #define CD_CLOTH_ORCO 23 #define CD_RECAST 24 -#ifdef USE_BMESH_FORWARD_COMPAT - /* BMESH ONLY START */ #define CD_MPOLY 25 #define CD_MLOOP 26 @@ -108,16 +108,11 @@ typedef struct CustomData { #define CD_SHAPEKEY 28 #define CD_BWEIGHT 29 #define CD_CREASE 30 -#define CD_WEIGHT_MLOOPCOL 31 +#define CD_ORIGSPACE_MLOOP 31 +#define CD_WEIGHT_MLOOPCOL 32 /* BMESH ONLY END */ -#define CD_NUMTYPES 32 - -#else - -#define CD_NUMTYPES 25 - -#endif +#define CD_NUMTYPES 33 /* Bits for CustomDataMask */ #define CD_MASK_MVERT (1 << CD_MVERT) @@ -144,8 +139,6 @@ typedef struct CustomData { #define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO) #define CD_MASK_RECAST (1 << CD_RECAST) -#ifdef USE_BMESH_FORWARD_COMPAT - /* BMESH ONLY START */ #define CD_MASK_MPOLY (1 << CD_MPOLY) #define CD_MASK_MLOOP (1 << CD_MLOOP) @@ -153,11 +146,10 @@ typedef struct CustomData { #define CD_MASK_SHAPEKEY (1 << CD_SHAPEKEY) #define CD_MASK_BWEIGHT (1 << CD_BWEIGHT) #define CD_MASK_CREASE (1 << CD_CREASE) -#define CD_MASK_WEIGHT_MLOOPCOL (1 << CD_WEIGHT_MLOOPCOL) +#define CD_MASK_ORIGSPACE_MLOOP (1 << CD_ORIGSPACE_MLOOP) +#define CD_MASK_WEIGHT_MLOOPCOL (1LL << CD_WEIGHT_MLOOPCOL) /* BMESH ONLY END */ -#endif - /* CustomData.flag */ /* indicates layer should not be copied by CustomData_from_template or diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h index aa2cfb3f6e9..762e027f934 100644 --- a/source/blender/makesdna/DNA_defs.h +++ b/source/blender/makesdna/DNA_defs.h @@ -45,7 +45,8 @@ /* hrmf, we need a better include then this */ #include "../blenloader/BLO_sys_types.h" /* needed for int64_t only! */ -#define USE_BMESH_FORWARD_COMPAT +/* Must not be defined for BMesh, as this guards code for pre-BMesh code to load BMesh .blend files */ +/* #define USE_BMESH_FORWARD_COMPAT */ /* non-id name variables should use this length */ #define MAX_NAME 64 diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h index d27ec513cc1..f2840a3b9b7 100644 --- a/source/blender/makesdna/DNA_key_types.h +++ b/source/blender/makesdna/DNA_key_types.h @@ -53,6 +53,8 @@ typedef struct KeyBlock { float slidermin; float slidermax; + + int uid, pad3; } KeyBlock; @@ -72,6 +74,9 @@ typedef struct Key { short type, totkey; short slurph, flag; + + /*can never be 0, this is used for detecting old data*/ + int uidgen, pad; /*current free uid for keyblocks*/ } Key; /* **************** KEY ********************* */ @@ -92,5 +97,5 @@ typedef struct Key { #define KEYBLOCK_MUTE (1<<0) #define KEYBLOCK_SEL (1<<1) #define KEYBLOCK_LOCKED (1<<2) - +#define KEYBLOCK_MISSING (1<<3) /*temporary flag*/ #endif diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index ea626b5221d..f422e80b864 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -69,7 +69,6 @@ typedef struct Mesh { struct Key *key; struct Material **mat; -/*#ifdef USE_BMESH_FORWARD_COMPAT*/ /* XXX - ifdefs dont work here! */ /* BMESH ONLY */ /*new face structures*/ struct MPoly *mpoly; @@ -78,36 +77,36 @@ typedef struct Mesh { struct MLoopUV *mloopuv; struct MLoopCol *mloopcol; /* END BMESH ONLY */ -/*#endif*/ - struct MFace *mface; /* array of mesh object mode faces */ - struct MTFace *mtface; /* store face UV's and texture here */ + /*mface stores the tesselation (triangulation) of the mesh, + real faces are now stored in nface.*/ + struct MFace *mface; /* array of mesh object mode faces for tesselation */ + struct MTFace *mtface; /* store tesselation face UV's and texture here */ struct TFace *tface; /* depecrated, use mtface */ struct MVert *mvert; /* array of verts */ struct MEdge *medge; /* array of edges */ struct MDeformVert *dvert; /* deformgroup vertices */ - struct MCol *mcol; /* array of colors, this must be the number of faces * 4 */ + + /* array of colors for the tesselated faces, must be number of tesselated + faces * 4 in length */ + struct MCol *mcol; struct MSticky *msticky; struct Mesh *texcomesh; struct MSelect *mselect; - struct EditMesh *edit_mesh; /* not saved in file! */ + struct BMEditMesh *edit_btmesh; /* not saved in file! */ struct CustomData vdata, edata, fdata; -/*#ifdef USE_BMESH_FORWARD_COMPAT*/ /* XXX - ifdefs dont work here! */ /* BMESH ONLY */ struct CustomData pdata, ldata; /* END BMESH ONLY */ -/*#endif*/ int totvert, totedge, totface, totselect; -/*#ifdef USE_BMESH_FORWARD_COMPAT*/ /* BMESH ONLY */ int totpoly, totloop; /* END BMESH ONLY */ -/*#endif*/ /* XXX - ifdefs dont work here! */ /* the last selected vertex/edge/face are used for the active face however * this means the active face must always be selected, this is to keep track @@ -229,9 +228,8 @@ typedef struct TFace { /* this is so we can save bmesh files that load in trunk, ignoring NGons * will eventually be removed */ -#if 0 /* enable in bmesh branch only for now */ #define USE_BMESH_SAVE_AS_COMPAT -#endif +#define USE_BMESH_SAVE_WITHOUT_MFACE #endif diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index e0a793f3371..53f9ff101a3 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -38,6 +38,7 @@ struct Bone; struct Image; +/*tesselation face, see MLoop/MPoly for the real face data*/ typedef struct MFace { unsigned int v1, v2, v3, v4; short mat_nr; @@ -67,14 +68,13 @@ typedef struct MVert { char flag, bweight; } MVert; -/* at the moment alpha is abused for vertex painting - * and not used for transperency, note that red and blue are swapped */ +/* tesselation vertex color data. + * at the moment alpha is abused for vertex painting + * and not used for transparency, note that red and blue are swapped */ typedef struct MCol { char a, r, g, b; } MCol; -#ifdef USE_BMESH_FORWARD_COMPAT - /*new face structure, replaces MFace, which is now only used for storing tesselations.*/ typedef struct MPoly { @@ -92,19 +92,35 @@ typedef struct MLoop { unsigned int e; /*edge index*/ } MLoop; -#endif /* USE_BMESH_FORWARD_COMPAT */ - -/*bmesh custom data stuff*/ typedef struct MTexPoly { struct Image *tpage; char flag, transp; short mode,tile,unwrap; } MTexPoly; +/* can copy from/to MTexPoly/MTFace */ +#define ME_MTEXFACE_CPY(dst, src) \ +{ \ + (dst)->tpage = (src)->tpage; \ + (dst)->flag = (src)->flag; \ + (dst)->transp = (src)->transp; \ + (dst)->mode = (src)->mode; \ + (dst)->tile = (src)->tile; \ + (dst)->unwrap = (src)->unwrap; \ +} + typedef struct MLoopUV { float uv[2]; + int flag; } MLoopUV; +/*mloopuv->flag*/ +#define MLOOPUV_EDGESEL 1 +#define MLOOPUV_VERTSEL 2 +#define MLOOPUV_PINNED 4 + +/* at the moment alpha is abused for vertex painting + * and not used for transparency, note that red and blue are swapped */ typedef struct MLoopCol { char a, r, g, b; } MLoopCol; @@ -118,6 +134,7 @@ typedef struct MSelect { int type; /* EDITVERT/EDITEDGE/EDITFACE */ } MSelect; +/*tesselation uv face data*/ typedef struct MTFace { float uv[4][2]; struct Image *tpage; @@ -140,6 +157,10 @@ typedef struct OrigSpaceFace { float uv[4][2]; } OrigSpaceFace; +typedef struct OrigSpaceLoop { + float uv[2]; +} OrigSpaceLoop; + typedef struct MDisps { /* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */ int totdisp; @@ -233,7 +254,16 @@ typedef struct MRecast { #define ME_SMOOTH 1 #define ME_FACE_SEL 2 #define ME_FREESTYLE_FACE 4 - /* flag ME_HIDE==16 is used here too */ +/* flag ME_HIDE==16 is used here too */ + +#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)]) +#define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)]) + +/* mselect->type */ +#define ME_VSEL 0 +#define ME_ESEL 1 +#define ME_FSEL 2 + /* mtface->flag */ #define TF_SELECT 1 /* use MFace hide flag (after 2.43), should be able to reuse after 2.44 */ #define TF_ACTIVE 2 /* deprecated! */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 0899b77abbc..93e8c2973f2 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -77,6 +77,7 @@ typedef enum ModifierType { eModifierType_Ocean, eModifierType_DynamicPaint, eModifierType_Remesh, + eModifierType_NgonInterp, NUM_MODIFIER_TYPES } ModifierType; @@ -676,6 +677,7 @@ typedef struct ShrinkwrapModifierData { #define MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS (1<<2) #define MOD_SHRINKWRAP_PROJECT_OVER_NORMAL 0 /* projection over normal is used if no axis is selected */ + typedef struct SimpleDeformModifierData { ModifierData modifier; @@ -808,9 +810,14 @@ typedef struct OceanModifierData { #define MOD_OCEAN_GENERATE_NORMALS 2 -typedef struct WarpModifierData { +/* BMESH_ONLY */ +typedef struct NgonInterpModifierData { ModifierData modifier; + int resolution, pad0; +} NgonInterpModifierData; +typedef struct WarpModifierData { + ModifierData modifier; /* keep in sync with MappingInfoModifierData */ struct Tex *texture; struct Object *map_object; diff --git a/source/blender/makesdna/DNA_vec_types.h b/source/blender/makesdna/DNA_vec_types.h index 0e832b8c95f..1420ca48c22 100644 --- a/source/blender/makesdna/DNA_vec_types.h +++ b/source/blender/makesdna/DNA_vec_types.h @@ -60,11 +60,11 @@ typedef struct vec2d { typedef struct vec3i { int x, y, z; } vec3i; - +*/ typedef struct vec3f { float x, y, z; } vec3f; - +/* typedef struct vec3d { double x, y, z; } vec3d; diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 8185676cbfc..a819d827788 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -18,7 +18,7 @@ dna = env.Clone() makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ') makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc', - '../../makesdna', '../../blenloader']) + '../../makesdna', '../../blenloader', '../../bmesh']) if env['OURPLATFORM'] == 'linuxcross': USE_WINE = True # when cross compiling on linux 64bit this is useful diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 5b115a404ce..9c2289b2edd 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -42,6 +42,7 @@ #include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN #ifdef WITH_DNA_GHASH +# include "BLI_utildefines.h" # include "BLI_ghash.h" #endif @@ -389,7 +390,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) while(nr<sdna->nr_types) { sdna->types[nr]= cp; - /* this is a patch, to change struct names without a confict with SDNA */ + /* this is a patch, to change struct names without a conflict with SDNA */ /* be careful to use it, in this case for a system-struct (opengl/X) */ if( *cp == 'b') { |