diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-09-09 10:28:58 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-09-09 10:28:58 +0400 |
commit | e0a014a45f23cbc0a073a4d70afdd999ef3bdbab (patch) | |
tree | 0aeb31f67e141c3cd6d17cfaad9dcb2b3506b96d /source/blender/blenkernel | |
parent | 287cc0fad81913540644c2fc608a9cd9a2f0e670 (diff) |
finished removedoubles, and inlined a bunch of functions.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_tessmesh.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_utildefines.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 37 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifiers_bmesh.c | 10 |
4 files changed, 41 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_tessmesh.h b/source/blender/blenkernel/BKE_tessmesh.h index b01cd3c2e89..daad8665d1a 100644 --- a/source/blender/blenkernel/BKE_tessmesh.h +++ b/source/blender/blenkernel/BKE_tessmesh.h @@ -24,6 +24,7 @@ typedef struct BMEditMesh { /*this is for undoing failed operations*/ struct BMEditMesh *emcopy; + int emcopyusers; /*we store tesselations as triplets of three loops, which each define a triangle.*/ diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 950c89aaa89..6343ea51b13 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -241,7 +241,7 @@ behaviour, though it may not be the best in practice. /*little macro so inline keyword works*/ #if defined(_MSC_VER) -#define BM_INLINE //__forceinline +#define BM_INLINE __forceinline #else #define BM_INLINE inline #endif diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 9bb418c4f86..2e4146437a2 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -2171,6 +2171,43 @@ static DerivedMesh *mirrorModifier_applyModifierEM( /* EdgeSplit modifier: Splits edges in the mesh according to sharpness flag * or edge angle (can be used to achieve autosmoothing) */ + +/*new cddm-based edge split code*/ +#if 0 +typedef struct VertUser { + int ov, v, done; + ListBase users; +} VertUser; + +typedef struct EdgeNode { + struct EdgeNode *next, *prev; + struct EdgeData *edge; +} EdgeNode; + +typedef struct EdgeData { + EdgeNode v1list, v2list; + VertUser *v1user, *v2user; + int tag; + int v1, v2; +} EdgeData; + +DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd) +{ + DerivedMesh *cddm = CDDM_copy(dm); + EdgeData *etags; + VertUser *vusers; + + if (!cddm->numVertData || !cddm->numEdgeData) + return cddm; + + etags = MEM_callocN(sizeof(EdgeData)*cddm->numEdgeData, "edgedata tag thingies"); + + MEM_freeN(etags); + return cddm; +} + +#endif + #if 0 #define EDGESPLIT_DEBUG_3 #define EDGESPLIT_DEBUG_2 diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c index 7b4edc3c622..22613d28a92 100644 --- a/source/blender/blenkernel/intern/modifiers_bmesh.c +++ b/source/blender/blenkernel/intern/modifiers_bmesh.c @@ -275,7 +275,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, Scene *scene, Object *ob, DerivedMesh *dm, int initFlags) { - DerivedMesh *cddm = dm; //CDDM_copy(dm); copying shouldn't be necassary here, as all modifiers return CDDM's + DerivedMesh *cddm = dm; //copying shouldn't be necassary here, as all modifiers return CDDM's BMEditMesh *em = CDDM_To_BMesh(cddm, NULL); BMOperator op, oldop, weldop; int i, j, indexLen; @@ -388,9 +388,6 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, MTC_Mat4CpyMat4(final_offset, tmp_mat); } - //cddm->needsFree = 1; - //cddm->release(cddm); - BMO_Init_Op(&weldop, "weldverts"); BMO_InitOpf(em->bm, &op, "dupe geom=%avef"); oldop = op; @@ -535,12 +532,9 @@ DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, float mtx[4][4], imtx[4][4]; int i, j; - cddm = dm; //CDDM_copy(dm); copying shouldn't be necassary here, as all modifiers return CDDM's + cddm = dm; //copying shouldn't be necassary here, as all modifiers return CDDM's em = CDDM_To_BMesh(dm, NULL); - //cddm->needsFree = 1; - //cddm->release(cddm); - /*convienence variable*/ bm = em->bm; |