Modeling: Support "Auto Merge" for the bevel operator
The bevel operator can leave overlapping vertices. Support "Auto Merge" so these are cleaned when the tool-setting is enabled. Ref !142008
This commit is contained in:
committed by
Campbell Barton
parent
a27b309009
commit
a584197ab3
@@ -93,6 +93,9 @@ struct BevelData {
|
||||
float segments; /* Segments as float so smooth mouse pan works in small increments */
|
||||
|
||||
CurveProfile *custom_profile;
|
||||
|
||||
bool use_automerge;
|
||||
double automerge_threshold;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -242,6 +245,9 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
|
||||
/* Put the Curve Profile from the toolsettings into the opdata struct */
|
||||
opdata->custom_profile = ts->custom_bevel_profile_preset;
|
||||
|
||||
opdata->use_automerge = scene->toolsettings->automerge & AUTO_MERGE;
|
||||
opdata->automerge_threshold = scene->toolsettings->doublimit;
|
||||
|
||||
{
|
||||
const Vector<Object *> objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
|
||||
scene, view_layer, v3d);
|
||||
@@ -381,6 +387,9 @@ static bool edbm_bevel_calc(wmOperator *op)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opdata->use_automerge) {
|
||||
EDBM_automerge_connected(obedit, true, BM_ELEM_SELECT, opdata->automerge_threshold);
|
||||
}
|
||||
|
||||
/* no need to de-select existing geometry */
|
||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||
|
||||
Reference in New Issue
Block a user