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:
authorRohan Rathi <rohanrathi08@gmail.com>2017-08-29 17:09:17 +0300
committerRohan Rathi <rohanrathi08@gmail.com>2017-08-29 17:09:17 +0300
commit18df6576318bf020476a6f87e93484c5f4ab6dd4 (patch)
treea5183bd205463f96b24a7eb79a11ce448296bda5 /source/blender/modifiers/intern/MOD_weighted_normal.c
parent8c942d9708e24589b87d6ace14b494f6256d72cd (diff)
Changed T_CLNOR_INVALIDATE flag as it conflicted with prop edit. Fixed mistake with weighting in modifier making it work differently from average.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weighted_normal.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weighted_normal.c10
1 files changed, 5 insertions, 5 deletions
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;
}