[Bf-blender-cvs] [567aad9dcdc] master: Fix T97152: Selection tools do nothing in particle hair edit

Campbell Barton noreply at git.blender.org
Wed Apr 13 08:28:16 CEST 2022


Commit: 567aad9dcdcbcb4d05d4945a4cd493f809fcfe8c
Author: Campbell Barton
Date:   Wed Apr 13 16:22:17 2022 +1000
Branches: master
https://developer.blender.org/rB567aad9dcdcbcb4d05d4945a4cd493f809fcfe8c

Fix T97152: Selection tools do nothing in particle hair edit

Regression in [0] which caused canceled PRESS events not to generate
CLICK_DRAG.

Resolve by checking for an active brush tool in poll instead of the
PARTICLE_OT_brush_edit invoke function.

[0]: 4d0f846b936c9101ecb76a6db962aac2d74a460a,

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

M	source/blender/editors/physics/particle_edit.c

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

diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index eba647a1b17..0e03feba340 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4693,10 +4693,6 @@ static int brush_edit_init(bContext *C, wmOperator *op)
   BrushEdit *bedit;
   float min[3], max[3];
 
-  if (!WM_toolsystem_active_tool_is_brush(C)) {
-    return 0;
-  }
-
   /* set the 'distance factor' for grabbing (used in comb etc) */
   INIT_MINMAX(min, max);
   PE_minmax(depsgraph, scene, view_layer, min, max);
@@ -5033,6 +5029,11 @@ static void brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
   brush_edit_exit(op);
 }
 
+static bool brush_edit_poll(bContext *C)
+{
+  return PE_poll_view3d(C) && WM_toolsystem_active_tool_is_brush(C);
+}
+
 void PARTICLE_OT_brush_edit(wmOperatorType *ot)
 {
   /* identifiers */
@@ -5045,7 +5046,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
   ot->invoke = brush_edit_invoke;
   ot->modal = brush_edit_modal;
   ot->cancel = brush_edit_cancel;
-  ot->poll = PE_poll_view3d;
+  ot->poll = brush_edit_poll;
 
   /* flags */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;



More information about the Bf-blender-cvs mailing list