From d795c00b887c0f520d01d2d912ee03c0de84f261 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Thu, 9 Mar 2023 15:19:08 -0800 Subject: [PATCH] Sculpt: Fix #105557 Bugs in new sculpt menu entries Note: the wrong hotkeys are still displayed for move/rotate/scale, for some reason the base view3d keymap values are being used. --- scripts/startup/bl_ui/space_view3d.py | 4 ++-- source/blender/editors/sculpt_paint/paint_mask.cc | 4 ++++ source/blender/editors/sculpt_paint/sculpt_face_set.cc | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index ef3431fbe0a..b60988353fc 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -3260,13 +3260,13 @@ class VIEW3D_MT_sculpt(Menu): props = layout.operator("sculpt.trim_box_gesture", text="Box Trim") props.trim_mode = 'DIFFERENCE' - layout.operator("sculpt.trim_lasso_gesture", text="Lasso Trim") + props = layout.operator("sculpt.trim_lasso_gesture", text="Lasso Trim") props.trim_mode = 'DIFFERENCE' props = layout.operator("sculpt.trim_box_gesture", text="Box Add") props.trim_mode = 'JOIN' - layout.operator("sculpt.trim_lasso_gesture", text="Lasso Add") + props = layout.operator("sculpt.trim_lasso_gesture", text="Lasso Add") props.trim_mode = 'JOIN' layout.operator("sculpt.project_line_gesture", text="Line Project") diff --git a/source/blender/editors/sculpt_paint/paint_mask.cc b/source/blender/editors/sculpt_paint/paint_mask.cc index 1dbc14a2324..d06dc91af68 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.cc +++ b/source/blender/editors/sculpt_paint/paint_mask.cc @@ -1711,7 +1711,11 @@ static int sculpt_trim_gesture_box_invoke(bContext *C, wmOperator *op, const wmE static int sculpt_trim_gesture_lasso_exec(bContext *C, wmOperator *op) { + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *object = CTX_data_active_object(C); + + BKE_sculpt_update_object_for_edit(depsgraph, object, false, true, false); + SculptSession *ss = object->sculpt; if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) { /* Not supported in Multires and Dyntopo. */ diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 6edd3ede005..29a3d3920f9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -1473,7 +1473,7 @@ void SCULPT_OT_face_sets_edit(struct wmOperatorType *ot) ot->invoke = sculpt_face_set_edit_invoke; ot->poll = SCULPT_mode_poll; - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR; RNA_def_enum( ot->srna, "mode", prop_sculpt_face_sets_edit_types, SCULPT_FACE_SET_EDIT_GROW, "Mode", "");