[Bf-blender-cvs] [d83c0969f6e] master: Fix T74426: Crash in the IK Pose Brush preview with null preview chain

Pablo Dobarro noreply at git.blender.org
Wed Mar 4 12:24:32 CET 2020


Commit: d83c0969f6ee6d193f384341cbbd0455ef46dabd
Author: Pablo Dobarro
Date:   Wed Mar 4 12:12:28 2020 +0100
Branches: master
https://developer.blender.org/rBd83c0969f6ee6d193f384341cbbd0455ef46dabd

Fix T74426: Crash in the IK Pose Brush preview with null preview chain

After switching tools, the active vertex can be the same and the cursor
won't update the previews, so the pose_ik_chain_preview will be null.
This often happens in low poly meshes where chances of hovering the same
vertex are high.

Reviewed By: sergey

Maniphest Tasks: T74426

Differential Revision: https://developer.blender.org/D7021

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index a5da577859a..7198fb7df11 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1477,7 +1477,11 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
           /* Draw pose brush origins. */
           if (brush->sculpt_tool == SCULPT_TOOL_POSE) {
             immUniformColor4f(1.0f, 1.0f, 1.0f, 0.8f);
-            if (update_previews) {
+
+            /* Just after switching to the Pose Brush, the active vertex can be the same and the
+             * cursor won't be tagged to update, so always initialize the preview chain if it is
+             * null before drawing it. */
+            if (update_previews || !ss->pose_ik_chain_preview) {
               BKE_sculpt_update_object_for_edit(depsgraph, vc.obact, true, false);
 
               /* Free the previous pose brush preview. */



More information about the Bf-blender-cvs mailing list