diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 01:39:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-12 01:39:09 +0400 |
commit | 566464366ff52a92600c27d6f8fc99d544436cb2 (patch) | |
tree | 7e8458f4b64f0a2a5f41ed319ee76bd15eda6c9d /source/blender/modifiers | |
parent | 025b10f7f26a8ba6aa6c025c317aee84449232c0 (diff) |
solidify modifier fix for material offset.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 59fc2db54f1..fd6d0f602a9 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -220,7 +220,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* only use material offsets if we have 2 or more materials */ const short mat_nr_max= ob->totcol > 1 ? ob->totcol - 1 : 0; const short mat_ofs= mat_nr_max ? smd->mat_ofs : 0; - /* const short mat_ofs_rim= mat_nr_max ? smd->mat_ofs_rim : 0; */ /* UNUSED */ + const short mat_ofs_rim= mat_nr_max ? smd->mat_ofs_rim : 0; /* use for edges */ int *new_vert_arr= NULL; @@ -365,13 +365,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, for (j=0; j<mp->totloop; j++) { CustomData_copy_data(&dm->loopData, &result->loopData, mp->loopstart+j, mp->loopstart+(mp->totloop-j-1)+dm->numLoopData, 1); + } - if(mat_ofs) { - mp->mat_nr += mat_ofs; - CLAMP(mp->mat_nr, 0, mat_nr_max); - } + if(mat_ofs) { + mp->mat_nr += mat_ofs; + CLAMP(mp->mat_nr, 0, mat_nr_max); } - + e = ml2[0].e; for (j=0; j<mp->totloop-1; j++) { ml2[j].e = ml2[j+1].e; @@ -641,6 +641,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, edge_origIndex[ml[j-3].e] = ORIGINDEX_NONE; edge_origIndex[ml[j-1].e] = ORIGINDEX_NONE; } + + /* use the next material index if option enabled */ + if(mat_ofs_rim) { + mp->mat_nr += mat_ofs_rim; + CLAMP(mp->mat_nr, 0, mat_nr_max); + } if(crease_outer) { /* crease += crease_outer; without wrapping */ unsigned char *cr= (unsigned char *)&(ed->crease); |