[Bf-blender-cvs] [caf5a32] master: Outliner 'Blender file' view: Show libs used both directly and indirectly both on main level and in nested tree.
Bastien Montagne
noreply at git.blender.org
Mon Jan 5 11:39:57 CET 2015
Commit: caf5a325b014e77e8a19fb8e40a3780964b609b6
Author: Bastien Montagne
Date: Mon Jan 5 11:28:34 2015 +0100
Branches: master
https://developer.blender.org/rBcaf5a325b014e77e8a19fb8e40a3780964b609b6
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
===================================================================
M source/blender/editors/space_outliner/outliner_tree.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 10cde8b..c6a6b8f 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;
}
More information about the Bf-blender-cvs
mailing list