[Bf-blender-cvs] [cee94789850] master: Fix T68499: weight paint gradient is broken with generative modifiers

Philipp Oeser noreply at git.blender.org
Thu Nov 21 13:24:42 CET 2019


Commit: cee94789850e99fc68dd398e7d1abd67f0e2b85d
Author: Philipp Oeser
Date:   Wed Nov 20 21:08:42 2019 +0100
Branches: master
https://developer.blender.org/rBcee94789850e99fc68dd398e7d1abd67f0e2b85d

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

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

M	source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c

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

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;
   }



More information about the Bf-blender-cvs mailing list