diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-11-20 23:08:42 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-11-21 15:20:04 +0300 |
commit | cee94789850e99fc68dd398e7d1abd67f0e2b85d (patch) | |
tree | 5029218744baed0365dc0ecde29938a487ee73b2 /source/blender | |
parent | 1fbb86654a82df7bbce0566b8b335f8631116d65 (diff) |
Fix T68499: weight paint gradient is broken with generative modifiers
Caused by rBac442da4a14d.
Above commit tweaked the logic to not only early out, but also set the
WPGradient_vertStore screen coord to FLT_MAX in case this original index
was visited before [gradientVertInit__mapFunc].
For generative modifiers though, we might get here multiple times for the
same orig index, resulting in a valid orig index being made invalid for
gradientVertUpdate__mapFunc [which would early out in case of FLT_MAX].
Restored original logic, so that setting FLT_MAX only really happens
when it should: when ED_view3d_project_float_object fails...
Maniphest Tasks: T68499
Differential Revision: https://developer.blender.org/D6282
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c index f0fe2d4ebdc..ae4ef59597b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -665,13 +665,15 @@ static void gradientVertInit__mapFunc(void *userData, * the screen coords of the verts need to be cached because * updating the mesh may move them about (entering feedback loop) */ if (BLI_BITMAP_TEST(grad_data->vert_visit, index)) { - copy_v2_fl(vs->sco, FLT_MAX); + /* Do not copy FLT_MAX here, for generative modifiers we are getting here + * multiple times with the same orig index. */ return; } if (ED_view3d_project_float_object( grad_data->ar, co, vs->sco, V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) { + copy_v2_fl(vs->sco, FLT_MAX); return; } |