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-01-09 13:30:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-09 13:30:04 +0400
commita31c40ac00ac7b0f54ba5aa3988f147f82219ea4 (patch)
treea4629870b95a1148f653fea6b3da3ae3a7d11def /source/blender
parent99d4f5e52e704d013a83b3d4aaae22463e04d46a (diff)
bugfix for solidify modifier rim faces which were created from triangles, would get wrong customdata copied since it used the 4th index of a tri.
fixed already in bmesh.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index ad47e3fe569..99f5117e3cd 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -554,11 +554,18 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
const unsigned char crease_outer= smd->crease_outer * 255.0f;
const unsigned char crease_inner= smd->crease_inner * 255.0f;
- const int edge_indices[4][4] = {
- {1, 0, 0, 1},
- {2, 1, 1, 2},
- {3, 2, 2, 3},
- {0, 3, 3, 0}};
+ const int edge_indices[2][4][4] = {
+ /* quad */
+ {{1, 0, 0, 1},
+ {2, 1, 1, 2},
+ {3, 2, 2, 3},
+ {0, 3, 3, 0}},
+ /* tri */
+ {{1, 0, 0, 1},
+ {2, 1, 1, 2},
+ {0, 2, 2, 0},
+ {0, 0, 0, 0}} /* unused for tris */
+ };
/* add faces & edges */
origindex= result->getEdgeDataArray(result, CD_ORIGINDEX);
@@ -581,6 +588,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
int eidx= new_edge_arr[i];
int fidx= edge_users[eidx];
int flip;
+ int is_tri;
if(fidx >= numFaces) {
fidx -= numFaces;
@@ -595,8 +603,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* copy most of the face settings */
DM_copy_face_data(dm, result, fidx, (numFaces * 2) + i, 1);
+ is_tri = (orig_mface[fidx].v4 == 0);
+
if(flip) {
- DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[edge_order[eidx]]);
+ DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[is_tri][edge_order[eidx]]);
mf->v1= ed->v1;
mf->v2= ed->v2;
@@ -604,7 +614,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
mf->v4= ed->v1 + numVerts;
}
else {
- DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[edge_order[eidx]]);
+ DM_swap_face_data(result, (numFaces * 2) + i, edge_indices[is_tri][edge_order[eidx]]);
mf->v1= ed->v2;
mf->v2= ed->v1;