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>2010-06-13 17:56:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-13 17:56:13 +0400
commit262cfb59d3822b54e3a9ece22b2cb0bc04342a36 (patch)
treec9dc29c4ea9af7dfcb74a9cff28114deb3209bf0 /source/blender/modifiers
parente7dd562095f2c313b0101ab4c398c4c79fdc0a3d (diff)
solidify rim material option, use the next material slot for rim faces.
a bit arbitrary but with most cases where solidify is used in durian we get UV texture stretching since there is no way to access the newly created size faces this gives us a way to switch out the material on the rim.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 72907f5a2ee..1eb8f288006 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -514,6 +514,8 @@ static DerivedMesh *applyModifier(ModifierData *md,
float (*edge_vert_nos)[3]= MEM_callocN(sizeof(float) * numVerts * 3, "solidify_edge_nos");
float nor[3];
#endif
+ /* maximum value -1, so we have room to increase */
+ const short mat_nr_shift= (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) ? ob->totcol-1 : -1;
const unsigned char crease_rim= smd->crease_rim * 255.0f;
const unsigned char crease_outer= smd->crease_outer * 255.0f;
@@ -572,6 +574,10 @@ static DerivedMesh *applyModifier(ModifierData *md,
mf->v3= ed->v1 + numVerts;
mf->v4= ed->v2 + numVerts;
}
+
+ /* use the next material index if option enabled */
+ if(mf->mat_nr < mat_nr_shift)
+ mf->mat_nr++;
if(crease_outer)
ed->crease= crease_outer;