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.
This commit is contained in:
Joseph Eagar 2023-03-09 15:19:08 -08:00
parent bd3c6801da
commit d795c00b88
3 changed files with 7 additions and 3 deletions

@ -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")

@ -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. */

@ -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", "");