From 567aad9dcdcbcb4d05d4945a4cd493f809fcfe8c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Apr 2022 16:22:17 +1000 Subject: 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, --- source/blender/editors/physics/particle_edit.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to '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; -- cgit v1.2.3