Commit: 88dd45e1e1bde5db43e8807b7def754dea8b01fc
Author: Alexander Gavrilov
Date:   Mon Oct 2 17:33:51 2017 +0300
Branches: master
https://developer.blender.org/rB88dd45e1e1bde5db43e8807b7def754dea8b01fc

Disable multithreaded weight paint when mirroring is enabled.

Mirroring writes to the mirror vertex within the direct vertex
draw function, which violates assumptions required for processing
vertices in parallel.

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c 
b/source/blender/editors/sculpt_paint/paint_vertex.c
index ea85ae70794..4dd218114f6 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1841,27 +1841,30 @@ static void wpaint_paint_leaves(
                .sd = sd, .ob = ob, .brush = brush, .nodes = nodes, .vp = vp, 
.wpd = wpd, .wpi = wpi, .me = me, .C = C,
        };
 
+       /* current mirroring code cannot be run in parallel */
+       bool use_threading = !(me->editflag & ME_EDIT_MIRROR_X);
+
        switch (brush->vertexpaint_tool) {
                case PAINT_BLEND_AVERAGE:
                        calculate_average_weight(&data, nodes, totnode);
                        BLI_task_parallel_range_ex(
                                0, totnode, &data, NULL, 0,
-                               do_wpaint_brush_draw_task_cb_ex, true, false);
+                               do_wpaint_brush_draw_task_cb_ex, use_threading, 
false);
                        break;
                case PAINT_BLEND_SMEAR:
                        BLI_task_parallel_range_ex(
                                0, totnode, &data, NULL, 0,
-                               do_wpaint_brush_smear_task_cb_ex, true, false);
+                               do_wpaint_brush_smear_task_cb_ex, 
use_threading, false);
                        break;
                case PAINT_BLEND_BLUR:
                        BLI_task_parallel_range_ex(
                                0, totnode, &data, NULL, 0,
-                               do_wpaint_brush_blur_task_cb_ex, true, false);
+                               do_wpaint_brush_blur_task_cb_ex, use_threading, 
false);
                        break;
                default:
                        BLI_task_parallel_range_ex(
                                0, totnode, &data, NULL, 0,
-                               do_wpaint_brush_draw_task_cb_ex, true, false);
+                               do_wpaint_brush_draw_task_cb_ex, use_threading, 
false);
                        break;
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to