diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 18:28:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 18:28:07 +0300 |
commit | 0a69e3b307f05aeab8bd84f69560b4118c9bfaf2 (patch) | |
tree | 2dfeaae34f13c78bfd1594a78637ce31a95aba33 /source/blender/editors/metaball/mball_edit.c | |
parent | 92ea28101725631f8ebe6c6cfd37007175f1af03 (diff) |
Option not to select with un-hide
D1518 from @mba105 w/ edits
Diffstat (limited to 'source/blender/editors/metaball/mball_edit.c')
-rw-r--r-- | source/blender/editors/metaball/mball_edit.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 009aa921e11..5b4078b98b7 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -542,19 +542,21 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) /***************************** Unhide operator *****************************/ /* Unhide all edited MetaElems */ -static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) +static int reveal_metaelems_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); MetaBall *mb = (MetaBall *)obedit->data; - MetaElem *ml; - - ml = mb->editelems->first; + const bool select = RNA_boolean_get(op->ptr, "select"); + bool changed = false; - if (ml) { - while (ml) { + for (MetaElem *ml = mb->editelems->first; ml; ml = ml->next) { + if (ml->flag & MB_HIDE) { + SET_FLAG_FROM_TEST(ml->flag, select, SELECT); ml->flag &= ~MB_HIDE; - ml = ml->next; + changed = true; } + } + if (changed) { WM_event_add_notifier(C, NC_GEOM | ND_DATA, mb); DAG_id_tag_update(obedit->data, 0); } @@ -575,6 +577,9 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* props */ + RNA_def_boolean(ot->srna, "select", true, "Select", ""); } /* Select MetaElement with mouse click (user can select radius circle or |