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 14:10:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-22 14:10:14 +0400
commit8b2ffc1428bd8bd27568fa7e340841149addaaf5 (patch)
tree573bf4cbecfebd01f32fdeb80bf45adc9ff9161e /source/blender/modifiers
parentdbd70c05f799afb4d8a3584eae58af384ee14353 (diff)
fix for error in last commit and minor speedup to looping over edges.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 799c81b3da6..cd195e8e1aa 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -241,7 +241,7 @@ 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 - ofs_orig;
+ 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;
@@ -286,27 +286,26 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
edge_users[i] = INVALID_UNUSED;
}
-#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)); \
- if (edge_users[eidx] == INVALID_UNUSED) { \
- ed= orig_medge + eidx; \
- edge_users[eidx] = (ml_v1 < ml_v2) == (ed->v1 < ed->v2) ? i : (i + numFaces); \
- edge_order[eidx] = edge_ord; \
- } \
- else { \
- edge_users[eidx] = INVALID_PAIR; \
- } \
- } (void)0
-
for (i = 0, mp = orig_mpoly; i < numFaces; i++, mp++) {
- MLoop *ml;
-
- for (ml = orig_mloop + mp->loopstart, j = 0; j < mp->totloop; ml++, j++) {
- ADD_EDGE_USER(ml->v, ME_POLY_LOOP_NEXT(orig_mloop, mp, j)->v, j);
- }
+ MLoop *ml = orig_mloop + mp->loopstart;
+ unsigned int ml_v1;
+ unsigned int ml_v2;
+
+ for (j = 0, ml_v1 = ml->v, ml_v2 = ml[mp->totloop - 1].v;
+ j < mp->totloop;
+ j++, ml++, ml_v2 = ml_v1, ml_v1 = ml->v)
+ {
+ /* add edge user */
+ 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);
+ edge_order[eidx] = j;
+ }
+ else {
+ edge_users[eidx] = INVALID_PAIR;
+ }
+ }
}
#undef ADD_EDGE_USER