Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-05 13:28:34 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-05 13:28:48 +0300
commitcaf5a325b014e77e8a19fb8e40a3780964b609b6 (patch)
treec870a7e23961df346a1a1cfcaa6e1cbe7b1cfeeb /source/blender/editors/space_outliner
parent3414d014114158444f5d3fe7d307e832683bfebe (diff)
Outliner 'Blender file' view: Show libs used both directly and indirectly both on main level and in nested tree.
Request from Gooseberry team. This eases a bit managing dependancies in complex .blend files. Reviewers: campbellbarton Subscribers: fsiddi Projects: #user_interface, #bf_blender:_next Differential Revision: https://developer.blender.org/D943
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 10cde8b3316..c6a6b8f9697 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1536,10 +1536,19 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
tselem = TREESTORE(ten);
lib = (Library *)tselem->id;
if (lib && lib->parent) {
- BLI_remlink(&soops->tree, ten);
par = (TreeElement *)lib->parent->id.newid;
- BLI_addtail(&par->subtree, ten);
- ten->parent = par;
+ if (tselem->id->flag & LIB_INDIRECT) {
+ /* Only remove from 'first level' if lib is not also directly used. */
+ BLI_remlink(&soops->tree, ten);
+ BLI_addtail(&par->subtree, ten);
+ ten->parent = par;
+ }
+ else {
+ /* Else, make a new copy of the libtree for our parent. */
+ TreeElement *dupten = outliner_add_element(soops, &par->subtree, lib, NULL, 0, 0);
+ outliner_add_library_contents(mainvar, soops, dupten, lib);
+ dupten->parent = par;
+ }
}
ten = nten;
}