Tool System: inset tool now completes on release

This commit is contained in:
Campbell Barton 2018-04-27 20:37:13 +02:00
parent c0c9eb7fe2
commit c4a24a7f5d
2 changed files with 7 additions and 2 deletions

View File

@ -257,7 +257,7 @@ class _defs_edit_mesh:
icon = "ops.mesh.inset"
widget = None
keymap = (
("mesh.inset", dict(),
("mesh.inset", dict(release_confirm=True),
dict(type='ACTIONMOUSE', value='PRESS')),
)

View File

@ -378,7 +378,9 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
case LEFTMOUSE:
case PADENTER:
case RETKEY:
if (event->val == KM_PRESS) {
if ((event->val == KM_PRESS) ||
((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm")))
{
edbm_inset_calc(op);
edbm_inset_exit(C, op);
return OPERATOR_FINISHED;
@ -540,4 +542,7 @@ void MESH_OT_inset(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "use_select_inset", false, "Select Outer", "Select the new inset faces");
RNA_def_boolean(ot->srna, "use_individual", false, "Individual", "Individual Face Inset");
RNA_def_boolean(ot->srna, "use_interpolate", true, "Interpolate", "Blend face data across the inset");
prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}