[Bf-blender-cvs] [18df6576318] soc-2017-normal-tools: Changed T_CLNOR_INVALIDATE flag as it conflicted with prop edit. Fixed mistake with weighting in modifier making it work differently from average.

Rohan Rathi noreply at git.blender.org
Tue Aug 29 16:10:56 CEST 2017


Commit: 18df6576318bf020476a6f87e93484c5f4ab6dd4
Author: Rohan Rathi
Date:   Tue Aug 29 19:39:17 2017 +0530
Branches: soc-2017-normal-tools
https://developer.blender.org/rB18df6576318bf020476a6f87e93484c5f4ab6dd4

Changed T_CLNOR_INVALIDATE flag as it conflicted with prop edit. Fixed mistake with weighting in modifier making it work differently from average.

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

M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform.h
M	source/blender/modifiers/intern/MOD_weighted_normal.c

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

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 50a68f439fc..8d50e78424f 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2414,7 +2414,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 					BM_lnorspace_update(em->bm);
 					t->flag |= T_CLNOR_REBUILD;
 				}
-				BM_lnorspace_invalidate(em->bm, false);
+				BM_lnorspace_invalidate(em->bm, true);
 			}
 		}
 	}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 3d5d9ddfaa3..629d16e3abc 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -533,7 +533,7 @@ typedef struct TransInfo {
 	/* alternative transformation. used to add offset to tracking markers */
 #define T_ALT_TRANSFORM		(1 << 24)
 
-#define T_CLNOR_REBUILD		(1 << 25)
+#define T_CLNOR_REBUILD		(1 << 26)
 
 /* TransInfo->modifiers */
 #define	MOD_CONSTRAINT_SELECT	0x01
diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c
index 8735a737bf3..3e395fc41ec 100644
--- a/source/blender/modifiers/intern/MOD_weighted_normal.c
+++ b/source/blender/modifiers/intern/MOD_weighted_normal.c
@@ -499,16 +499,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
 	const bool use_invert_vgroup = (wnmd->flag & MOD_WEIGHTEDNORMAL_INVERT_VGROUP) != 0;
 	bool free_polynors = false;
 
-	float weight = ((float)wnmd->weight) / 10.0f;
+	float weight = ((float)wnmd->weight) / 50.0f;
 
-	if (wnmd->weight == 20) {
+	if (wnmd->weight == 100) {
 		weight = (float)SHRT_MAX;
 	}
 	else if (wnmd->weight == 1) {
 		weight = 1 / (float)SHRT_MAX;
 	}
-	else if (weight > 1) {
-		weight = (weight - 1) * 10;
+	else if ((weight - 1) * 25 > 1) {
+		weight = (weight - 1) * 25;
 	}
 
 	float (*polynors)[3] = dm->getPolyDataArray(dm, CD_NORMAL);
@@ -560,7 +560,7 @@ static void initData(ModifierData *md)
 {
 	WeightedNormalModifierData *wnmd = (WeightedNormalModifierData *)md;
 	wnmd->mode = MOD_WEIGHTEDNORMAL_MODE_FACE;
-	wnmd->weight = 10;
+	wnmd->weight = 50;
 	wnmd->thresh = 1e-2f;
 	wnmd->flag = 0;
 }



More information about the Bf-blender-cvs mailing list