[Bf-blender-cvs] [241248223a6] master: Change solidify's material offset in complex mode to conform with simple mode

Henrik Dick noreply at git.blender.org
Mon Mar 23 15:39:48 CET 2020


Commit: 241248223a6445a2de77dfd7439ca52c419d28ee
Author: Henrik Dick
Date:   Mon Mar 23 15:35:53 2020 +0100
Branches: master
https://developer.blender.org/rB241248223a6445a2de77dfd7439ca52c419d28ee

Change solidify's material offset in complex mode to conform with simple mode

this patch will change the behaviour of the material offset in complex mode to fit simple mode output.
Previously in complex mode this would offset the material of the enire shell,
because when you read the tooltip it says material for new generated geometry.
In complex mode everything is new generated geometry though.
In simple mode on the other hand, this would give you a way to only change the inside faces
material. There may be cases in large modifier stacks where material offset like it is implemented
currently in complex mode may be useful, but it is much more useful in the way it is implemented
by simple mode.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7215

===================================================================

M	source/blender/modifiers/intern/MOD_solidify_nonmanifold.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
index 3cd045b73ae..9c99f9b1e88 100644
--- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
+++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
@@ -2212,7 +2212,7 @@ Mesh *MOD_solidify_nonmanifold_applyModifier(ModifierData *md,
           CustomData_copy_data(&mesh->pdata, &result->pdata, (int)(i / 2), (int)poly_index, 1);
           mpoly[poly_index].loopstart = (int)loop_index;
           mpoly[poly_index].totloop = (int)k;
-          mpoly[poly_index].mat_nr = fr->face->mat_nr + mat_ofs;
+          mpoly[poly_index].mat_nr = fr->face->mat_nr + (fr->reversed ? mat_ofs : 0);
           CLAMP(mpoly[poly_index].mat_nr, 0, mat_nr_max);
           mpoly[poly_index].flag = fr->face->flag;
           if (fr->reversed != do_flip) {



More information about the Bf-blender-cvs mailing list