Cleanup: Remove unused SCULPT_OT_set_detail_size operator

This PR removes the unused `SCULPT_OT_set_detail_size` operator and related code.

Addresses cleanup of #108111 now that #118403 is merged in.

Pull Request: https://projects.blender.org/blender/blender/pulls/118591
This commit is contained in:
Sean Kim
2024-02-22 18:20:16 +01:00
committed by Hans Goudey
parent a3f0ff6184
commit 41cfb379af
3 changed files with 0 additions and 71 deletions

View File

@@ -394,75 +394,6 @@ void SCULPT_OT_sample_detail_size(wmOperatorType *ot)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Dynamic-topology detail size
*
* Currently, there are two operators editing the detail size:
* - #SCULPT_OT_set_detail_size uses radial control for all methods
* - #SCULPT_OT_dyntopo_detail_size_edit shows a triangle grid representation of the detail
* resolution (for constant detail method,
* falls back to radial control for the remaining methods).
* \{ */
static void set_brush_rc_props(PointerRNA *ptr, const char *prop)
{
char *path = BLI_sprintfN("tool_settings.sculpt.brush.%s", prop);
RNA_string_set(ptr, "data_path_primary", path);
MEM_freeN(path);
}
static void sculpt_detail_size_set_radial_control(bContext *C)
{
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
PointerRNA props_ptr;
wmOperatorType *ot = WM_operatortype_find("WM_OT_radial_control", true);
WM_operator_properties_create_ptr(&props_ptr, ot);
if (sd->flags & (SCULPT_DYNTOPO_DETAIL_CONSTANT | SCULPT_DYNTOPO_DETAIL_MANUAL)) {
set_brush_rc_props(&props_ptr, "constant_detail_resolution");
RNA_string_set(
&props_ptr, "data_path_primary", "tool_settings.sculpt.constant_detail_resolution");
}
else if (sd->flags & SCULPT_DYNTOPO_DETAIL_BRUSH) {
set_brush_rc_props(&props_ptr, "constant_detail_resolution");
RNA_string_set(&props_ptr, "data_path_primary", "tool_settings.sculpt.detail_percent");
}
else {
set_brush_rc_props(&props_ptr, "detail_size");
RNA_string_set(&props_ptr, "data_path_primary", "tool_settings.sculpt.detail_size");
}
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &props_ptr, nullptr);
WM_operator_properties_free(&props_ptr);
}
static int sculpt_set_detail_size_exec(bContext *C, wmOperator * /*op*/)
{
sculpt_detail_size_set_radial_control(C);
return OPERATOR_FINISHED;
}
void SCULPT_OT_set_detail_size(wmOperatorType *ot)
{
/* Identifiers. */
ot->name = "Set Detail Size";
ot->idname = "SCULPT_OT_set_detail_size";
ot->description =
"Set the mesh detail (either relative or constant one, depending on current dyntopo mode)";
/* API callbacks. */
ot->exec = sculpt_set_detail_size_exec;
ot->poll = sculpt_and_dynamic_topology_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Dyntopo Detail Size Edit Operator
* \{ */

View File

@@ -1725,7 +1725,6 @@ namespace blender::ed::sculpt_paint::dyntopo {
void SCULPT_OT_detail_flood_fill(wmOperatorType *ot);
void SCULPT_OT_sample_detail_size(wmOperatorType *ot);
void SCULPT_OT_set_detail_size(wmOperatorType *ot);
void SCULPT_OT_dyntopo_detail_size_edit(wmOperatorType *ot);
void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot);

View File

@@ -1294,7 +1294,6 @@ void ED_operatortypes_sculpt()
WM_operatortype_append(SCULPT_OT_symmetrize);
WM_operatortype_append(dyntopo::SCULPT_OT_detail_flood_fill);
WM_operatortype_append(dyntopo::SCULPT_OT_sample_detail_size);
WM_operatortype_append(dyntopo::SCULPT_OT_set_detail_size);
WM_operatortype_append(filter::SCULPT_OT_mesh_filter);
WM_operatortype_append(mask::SCULPT_OT_mask_filter);
WM_operatortype_append(SCULPT_OT_set_pivot_position);