diff options
author | Campbell Barton <campbell@blender.org> | 2022-04-13 09:22:17 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-04-13 09:27:21 +0300 |
commit | 567aad9dcdcbcb4d05d4945a4cd493f809fcfe8c (patch) | |
tree | 1f91c59eea9c27532978a6d3ee62cbe8253e63de /source/blender | |
parent | 9a659f2573b3d51a3f0a5390b02f33b4863d53aa (diff) |
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,
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 11 |
1 files changed, 6 insertions, 5 deletions
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; |