Fix #91188: Change identifier prefix for some sculpt mode operations

With `MESH_OT` prefix, the shortcut was added to wrong
keymap ("object mode", see: `WM_keymap_guess_opname`).
idname of following operations has been changed, they are
only exposed in sculpt mode UI (also see their poll function:
`geometry_extract_poll`):
- `face_set_extract`
- `paint_mask_extract`
- `paint_mask_slice`

Pull Request: https://projects.blender.org/blender/blender/pulls/133852
This commit is contained in:
Pratik Borhade
2025-05-07 10:30:58 +02:00
committed by Pratik Borhade
parent 8069bf801b
commit ea439fdf0c
4 changed files with 17 additions and 17 deletions

View File

@@ -3882,16 +3882,16 @@ class VIEW3D_MT_mask(Menu):
layout.separator()
props = layout.operator("mesh.paint_mask_extract", text="Mask Extract")
props = layout.operator("sculpt.paint_mask_extract", text="Mask Extract")
layout.separator()
props = layout.operator("mesh.paint_mask_slice", text="Mask Slice")
props = layout.operator("sculpt.paint_mask_slice", text="Mask Slice")
props.fill_holes = False
props.new_object = False
props = layout.operator("mesh.paint_mask_slice", text="Mask Slice and Fill Holes")
props = layout.operator("sculpt.paint_mask_slice", text="Mask Slice and Fill Holes")
props.new_object = False
props = layout.operator("mesh.paint_mask_slice", text="Mask Slice to New Object")
props = layout.operator("sculpt.paint_mask_slice", text="Mask Slice to New Object")
layout.separator()
@@ -3960,7 +3960,7 @@ class VIEW3D_MT_face_sets(Menu):
layout.separator()
props = layout.operator("mesh.face_set_extract", text="Extract Face Set")
props = layout.operator("sculpt.face_set_extract", text="Extract Face Set")
layout.separator()

View File

@@ -337,11 +337,11 @@ static void geometry_extract_props(StructRNA *srna)
"Extract the mask as a solid object with a solidify modifier");
}
void MESH_OT_paint_mask_extract(wmOperatorType *ot)
void SCULPT_OT_paint_mask_extract(wmOperatorType *ot)
{
ot->name = "Mask Extract";
ot->description = "Create a new mesh object from the current paint mask";
ot->idname = "MESH_OT_paint_mask_extract";
ot->idname = "SCULPT_OT_paint_mask_extract";
ot->poll = geometry_extract_poll;
ot->invoke = paint_mask_extract_invoke;
@@ -389,11 +389,11 @@ static wmOperatorStatus face_set_extract_invoke(bContext *C, wmOperator *op, con
return geometry_extract_apply(C, op, geometry_extract_tag_face_set, &params);
}
void MESH_OT_face_set_extract(wmOperatorType *ot)
void SCULPT_OT_face_set_extract(wmOperatorType *ot)
{
ot->name = "Face Set Extract";
ot->description = "Create a new mesh object from the selected Face Set";
ot->idname = "MESH_OT_face_set_extract";
ot->idname = "SCULPT_OT_face_set_extract";
ot->poll = geometry_extract_poll;
ot->invoke = face_set_extract_invoke;
@@ -552,13 +552,13 @@ static wmOperatorStatus paint_mask_slice_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
void MESH_OT_paint_mask_slice(wmOperatorType *ot)
void SCULPT_OT_paint_mask_slice(wmOperatorType *ot)
{
PropertyRNA *prop;
ot->name = "Mask Slice";
ot->description = "Slices the paint mask from the mesh";
ot->idname = "MESH_OT_paint_mask_slice";
ot->idname = "SCULPT_OT_paint_mask_slice";
ot->poll = geometry_extract_poll;
ot->exec = paint_mask_slice_exec;

View File

@@ -300,9 +300,9 @@ void MESH_OT_flip_quad_tessellation(wmOperatorType *ot);
/* *** editmesh_mask_extract.cc *** */
void MESH_OT_paint_mask_extract(wmOperatorType *ot);
void MESH_OT_face_set_extract(wmOperatorType *ot);
void MESH_OT_paint_mask_slice(wmOperatorType *ot);
void SCULPT_OT_paint_mask_extract(wmOperatorType *ot);
void SCULPT_OT_face_set_extract(wmOperatorType *ot);
void SCULPT_OT_paint_mask_slice(wmOperatorType *ot);
/** Called in `transform_ops.cc`, on each regeneration of key-maps. */
wmKeyMap *point_normals_modal_keymap(wmKeyConfig *keyconf);

View File

@@ -178,9 +178,9 @@ void ED_operatortypes_mesh()
WM_operatortype_append(MESH_OT_symmetrize);
WM_operatortype_append(MESH_OT_symmetry_snap);
WM_operatortype_append(MESH_OT_paint_mask_extract);
WM_operatortype_append(MESH_OT_face_set_extract);
WM_operatortype_append(MESH_OT_paint_mask_slice);
WM_operatortype_append(SCULPT_OT_paint_mask_extract);
WM_operatortype_append(SCULPT_OT_face_set_extract);
WM_operatortype_append(SCULPT_OT_paint_mask_slice);
WM_operatortype_append(MESH_OT_point_normals);
WM_operatortype_append(MESH_OT_merge_normals);