diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-29 17:13:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-29 18:37:27 +0300 |
commit | 4d08ef822ce291744d40e0fef47975e7f61826e8 (patch) | |
tree | 6dc90cf637f756e54ba3ac8d67e0e4b9cb62af51 /source/blender/editors/space_outliner/outliner_collections.c | |
parent | 8252a414d8cb15b42726d6f96d01cae97514d793 (diff) |
Outliner/Collection: Operator to delete selected collections
This is part of T53495.
This operator is actually using existing code. The only new thing about it is
that it has a shortcut.
It will be exposed in the UI soon together with the nested collection operator.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_collections.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_collections.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 35d0a34b984..a01cfa4812a 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -51,6 +51,9 @@ #include "outliner_intern.h" /* own include */ +/* Prototypes. */ +static int collection_delete_exec(struct bContext *C, struct wmOperator *op); + /* -------------------------------------------------------------------- */ static LayerCollection *outliner_collection_active(bContext *C) @@ -422,6 +425,24 @@ void OUTLINER_OT_collection_nested_new(wmOperatorType *ot) } /**********************************************************************************/ +/* Delete selected collection. */ + +void OUTLINER_OT_collection_delete_selected(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Delete Selected Collections"; + ot->idname = "OUTLINER_OT_collection_delete_selected"; + ot->description = "Delete all the selected collections"; + + /* api callbacks */ + ot->exec = collection_delete_exec; + ot->poll = collections_editor_poll; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + +/**********************************************************************************/ /** * Returns true is selected element is a collection |