Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-22 13:53:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-22 13:53:33 +0400
commite7647e15859f524c1989847656e4ea228507d71b (patch)
treec244fab2372391863dcd4b44d579b41f4d733df1 /source/blender/modifiers
parentd3067dfaa226a9a4e59508878356f2fdf9b60d04 (diff)
solidify modifier - remove a loop on all edges.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 0ca4d8dcd4f..799c81b3da6 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -240,8 +240,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
float (*face_nors_result)[3] = NULL;
- const float ofs_orig = -(((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
- const float ofs_new = smd->offset - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
+ const float ofs_orig = -(((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
+ const float ofs_new = smd->offset - ofs_orig;
const float offset_fac_vg = smd->offset_fac_vg;
const float offset_fac_vg_inv = 1.0f - smd->offset_fac_vg;
@@ -266,22 +266,31 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
unsigned int v1, v2;
int eidx;
+#define INVALID_UNUSED -1
+#define INVALID_PAIR -2
+
+ edge_users = MEM_mallocN(sizeof(int) * numEdges, "solid_mod edges");
+ edge_order = MEM_mallocN(sizeof(char) * numEdges, "solid_mod eorder");
+
for (i = 0, mv = orig_mvert; i < numVerts; i++, mv++) {
mv->flag &= ~ME_VERT_TMP_TAG;
}
+ /* save doing 2 loops here... */
+#if 0
+ fill_vn_i(edge_users, numEdges, INVALID_UNUSED);
+#endif
+
for (i = 0, ed = orig_medge; i < numEdges; i++, ed++) {
BLI_edgehash_insert(edgehash, ed->v1, ed->v2, SET_INT_IN_POINTER(i));
+ edge_users[i] = INVALID_UNUSED;
}
-#define INVALID_UNUSED -1
-#define INVALID_PAIR -2
-
#define ADD_EDGE_USER(_v1, _v2, edge_ord) \
{ \
const unsigned int ml_v1 = _v1; \
const unsigned int ml_v2 = _v2; \
- eidx= GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, ml_v1, ml_v2)); \
+ eidx = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, ml_v1, ml_v2)); \
if (edge_users[eidx] == INVALID_UNUSED) { \
ed= orig_medge + eidx; \
edge_users[eidx] = (ml_v1 < ml_v2) == (ed->v1 < ed->v2) ? i : (i + numFaces); \
@@ -290,13 +299,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
else { \
edge_users[eidx] = INVALID_PAIR; \
} \
- }
-
+ } (void)0
- edge_users = MEM_mallocN(sizeof(int) * numEdges, "solid_mod edges");
- edge_order = MEM_mallocN(sizeof(char) * numEdges, "solid_mod eorder");
- fill_vn_i(edge_users, numEdges, INVALID_UNUSED);
-
for (i = 0, mp = orig_mpoly; i < numFaces; i++, mp++) {
MLoop *ml;