diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-04 19:05:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-04 19:06:59 +0300 |
commit | 6566013c913e033fdabac4f1efb46bf08342b4df (patch) | |
tree | cacbf38ddd8582c256011dcf01e981f262a6d6aa /source/blender/editors/mesh/editmesh_tools.c | |
parent | 04c0a46570efa1d8154a573663c77a49af32cb93 (diff) |
BMesh dissolve: enable use_verts for edge dissolve (by default)
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4f4a7998a87..db8c9398abe 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3502,10 +3502,16 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) /* -------------------------------------------------------------------- */ /* Dissolve */ -static void edbm_dissolve_prop__use_verts(wmOperatorType *ot) +static void edbm_dissolve_prop__use_verts(wmOperatorType *ot, bool value, int flag) { - RNA_def_boolean(ot->srna, "use_verts", 0, "Dissolve Verts", - "Dissolve remaining vertices"); + PropertyRNA *prop; + + prop = RNA_def_boolean(ot->srna, "use_verts", value, "Dissolve Verts", + "Dissolve remaining vertices"); + + if (flag) { + RNA_def_property_flag(prop, flag); + } } static void edbm_dissolve_prop__use_face_split(wmOperatorType *ot) { @@ -3590,7 +3596,7 @@ void MESH_OT_dissolve_edges(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - edbm_dissolve_prop__use_verts(ot); + edbm_dissolve_prop__use_verts(ot, true, 0); edbm_dissolve_prop__use_face_split(ot); } @@ -3629,7 +3635,7 @@ void MESH_OT_dissolve_faces(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - edbm_dissolve_prop__use_verts(ot); + edbm_dissolve_prop__use_verts(ot, false, 0); } @@ -3637,6 +3643,15 @@ static int edbm_dissolve_mode_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); + PropertyRNA *prop; + + prop = RNA_struct_find_property(op->ptr, "use_verts"); + if (!RNA_property_is_set(op->ptr, prop)) { + /* always enable in edge-mode */ + if ((em->selectmode & SCE_SELECT_FACE) == 0) { + RNA_property_boolean_set(op->ptr, prop, true); + } + } if (em->selectmode & SCE_SELECT_VERTEX) { return edbm_dissolve_verts_exec(C, op); @@ -3663,7 +3678,7 @@ void MESH_OT_dissolve_mode(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - edbm_dissolve_prop__use_verts(ot); + edbm_dissolve_prop__use_verts(ot, false, PROP_SKIP_SAVE); edbm_dissolve_prop__use_face_split(ot); edbm_dissolve_prop__use_boundary_tear(ot); } |