diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-09-24 17:08:46 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-09-24 17:16:40 +0300 |
commit | ede14b3856c5b8938e57d3db217d68a9399385f2 (patch) | |
tree | 701d0e545359c8c57f38a92d1c319d9853a64757 /source/blender/gpencil_modifiers/intern | |
parent | 95ec6e4dd373f58eebf3119e470ead4156c724b4 (diff) |
GPencil: Invert weight in Weight Proximity modifier
In meshes modifer the Lowest is 0 and Highest is 1.0 and this was working inverted for grease pencil. Now, it works equals to meshes modifier.
Also changed the tooltip to keep consistency with meshes modifier.
Diffstat (limited to 'source/blender/gpencil_modifiers/intern')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c index 0885828a3a0..4079485de8d 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c @@ -83,13 +83,13 @@ static float calc_point_weight_by_distance(Object *ob, float dist = len_v3v3(mmd->object->obmat[3], gvert); if (dist > dist_max) { - weight = 0.0f; + weight = 1.0f; } else if (dist <= dist_max && dist > dist_min) { - weight = (dist_max - dist) / max_ff((dist_max - dist_min), 0.0001f); + weight = 1.0f - ((dist_max - dist) / max_ff((dist_max - dist_min), 0.0001f)); } else { - weight = 1.0f; + weight = 0.0f; } return weight; |