From bf8962e442e51d76c0cdf669c3399bd0f83cd701 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Apr 2021 14:22:13 +1000 Subject: Fix sculpt mask operator crash running without a 3D view Add missing operator poll, depend on the 3D view for all sculpt paint/mask operators. --- source/blender/editors/sculpt_paint/paint_mask.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 7671f69ee05..b6ae6f8bee7 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -1650,7 +1650,7 @@ void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot) ot->modal = WM_gesture_lasso_modal; ot->exec = paint_mask_gesture_lasso_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1671,7 +1671,7 @@ void PAINT_OT_mask_box_gesture(wmOperatorType *ot) ot->modal = WM_gesture_box_modal; ot->exec = paint_mask_gesture_box_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1692,7 +1692,7 @@ void PAINT_OT_mask_line_gesture(wmOperatorType *ot) ot->modal = WM_gesture_straightline_oneshot_modal; ot->exec = paint_mask_gesture_line_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1713,6 +1713,8 @@ void SCULPT_OT_face_set_lasso_gesture(wmOperatorType *ot) ot->modal = WM_gesture_lasso_modal; ot->exec = face_set_gesture_lasso_exec; + ot->poll = SCULPT_mode_poll_view3d; + /* Properties. */ WM_operator_properties_gesture_lasso(ot); sculpt_gesture_operator_properties(ot); @@ -1728,7 +1730,7 @@ void SCULPT_OT_face_set_box_gesture(wmOperatorType *ot) ot->modal = WM_gesture_box_modal; ot->exec = face_set_gesture_box_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1747,7 +1749,7 @@ void SCULPT_OT_trim_lasso_gesture(wmOperatorType *ot) ot->modal = WM_gesture_lasso_modal; ot->exec = sculpt_trim_gesture_lasso_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1768,7 +1770,7 @@ void SCULPT_OT_trim_box_gesture(wmOperatorType *ot) ot->modal = WM_gesture_box_modal; ot->exec = sculpt_trim_gesture_box_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; @@ -1789,7 +1791,7 @@ void SCULPT_OT_project_line_gesture(wmOperatorType *ot) ot->modal = WM_gesture_straightline_oneshot_modal; ot->exec = project_gesture_line_exec; - ot->poll = SCULPT_mode_poll; + ot->poll = SCULPT_mode_poll_view3d; ot->flag = OPTYPE_REGISTER; -- cgit v1.2.3