diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 00:17:19 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 00:24:59 +0300 |
commit | 5138fe3c0a24d5890438eed90a70401d90423356 (patch) | |
tree | 1ebe19822d6e00dd4d4d2728baba476e04b0c3e7 /source/blender/editors/space_outliner/outliner_edit.c | |
parent | c24b4e0cd0f95687ced252477232166dd53a341b (diff) |
Outliner: "All Collections" mode showing the master collection hierarchy
Reordering is disabled for now. Link, unlink and override operators
are only available while in "Active Layer" mode, not in "All
Collections".
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_edit.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 5f3931a4a77..7d801318c33 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -307,6 +307,8 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot) static void do_item_rename(const Scene *scene, ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports) { + bool add_textbut = false; + /* can't rename rna datablocks entries or listbases */ if (ELEM(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE)) { /* do nothing */; @@ -319,10 +321,17 @@ static void do_item_rename(const Scene *scene, ARegion *ar, TreeElement *te, Tre else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) { BKE_report(reports, RPT_WARNING, "Cannot edit sequence name"); } - else if ((tselem->type == TSE_COLLECTION) && - (((LayerCollection *)te->directdata)->scene_collection == BKE_collection_master(scene))) - { - BKE_report(reports, RPT_WARNING, "Cannot edit name of master collection"); + else if (ELEM(tselem->type, TSE_LAYER_COLLECTION, TSE_SCENE_COLLECTION)) { + SceneCollection *master = BKE_collection_master(scene); + + if ((tselem->type == TSE_SCENE_COLLECTION && te->directdata == master) || + (((LayerCollection *)te->directdata)->scene_collection == master)) + { + BKE_report(reports, RPT_WARNING, "Cannot edit name of master collection"); + } + else { + add_textbut = true; + } } else if (ID_IS_LINKED_DATABLOCK(tselem->id)) { BKE_report(reports, RPT_WARNING, "Cannot edit external libdata"); @@ -331,6 +340,10 @@ static void do_item_rename(const Scene *scene, ARegion *ar, TreeElement *te, Tre BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library"); } else { + add_textbut = true; + } + + if (add_textbut) { tselem->flag |= TSE_TEXTBUT; ED_region_tag_redraw(ar); } |