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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-14 12:41:12 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-14 12:41:12 +0300
commit0eb32467131543f224a222f0caf42df4ff9d7d65 (patch)
treecb1ce1ef29ade468ca51fc6587e6809504fa7f60 /source/blender/modifiers/intern/MOD_normal_edit.c
parent4d58fac1b4ddcf424d78ee96b404445e8ccc6527 (diff)
Fix T55470: Add option to not fix polygons' winding to Edit Normals modifier.
this is actually adding option to add buggy behavior, but.. NPR often expects buggy behaviors, and its one of the main targets for normal editing. So think it's reasonable to add that option (disabled by default of course). Note that am not really happy with UI, but: * Not sure where to put it, it's kind of own self-contained area option. * Don't to make it too much visible, using this should be the exception!
Diffstat (limited to 'source/blender/modifiers/intern/MOD_normal_edit.c')
-rw-r--r--source/blender/modifiers/intern/MOD_normal_edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index 894f60e869d..0cf24d312dd 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -195,6 +195,7 @@ static void normalEditModifier_do_radial(
MVert *mvert, const int num_verts, MEdge *medge, const int num_edges,
MLoop *mloop, const int num_loops, MPoly *mpoly, const int num_polys)
{
+ const bool do_polynors_fix = (enmd->flag & MOD_NORMALEDIT_NO_POLYNORS_FIX) == 0;
int i;
float (*cos)[3] = MEM_malloc_arrayN((size_t)num_verts, sizeof(*cos), __func__);
@@ -272,7 +273,7 @@ static void normalEditModifier_do_radial(
mix_limit, mix_mode, num_verts, mloop, loopnors, nos, num_loops);
}
- if (polygons_check_flip(mloop, nos, dm->getLoopDataLayout(dm), mpoly, polynors, num_polys)) {
+ if (do_polynors_fix && polygons_check_flip(mloop, nos, dm->getLoopDataLayout(dm), mpoly, polynors, num_polys)) {
dm->dirty |= DM_DIRTY_TESS_CDLAYERS;
/* We need to recompute vertex normals! */
dm->calcNormals(dm);
@@ -294,6 +295,7 @@ static void normalEditModifier_do_directional(
MVert *mvert, const int num_verts, MEdge *medge, const int num_edges,
MLoop *mloop, const int num_loops, MPoly *mpoly, const int num_polys)
{
+ const bool do_polynors_fix = (enmd->flag & MOD_NORMALEDIT_NO_POLYNORS_FIX) == 0;
const bool use_parallel_normals = (enmd->flag & MOD_NORMALEDIT_USE_DIRECTION_PARALLEL) != 0;
float (*cos)[3] = MEM_malloc_arrayN((size_t)num_verts, sizeof(*cos), __func__);
@@ -351,7 +353,7 @@ static void normalEditModifier_do_directional(
mix_limit, mix_mode, num_verts, mloop, loopnors, nos, num_loops);
}
- if (polygons_check_flip(mloop, nos, dm->getLoopDataLayout(dm), mpoly, polynors, num_polys)) {
+ if (do_polynors_fix && polygons_check_flip(mloop, nos, dm->getLoopDataLayout(dm), mpoly, polynors, num_polys)) {
dm->dirty |= DM_DIRTY_TESS_CDLAYERS;
}