From f1a217c5f9f05045f1c38fb39ee12260ca4010b9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 1 Dec 2006 10:12:41 +0000 Subject: Library manegement features: - Outliner now shows hierarchy for Libraries, indicating which Library files invoked loading another. - SHIFT+F1 "Append" browser has a Library menu, allowing to directly browse into all open library files. This will prevent accidents like re-opening a same .blend via another path. --- source/blender/src/outliner.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'source/blender/src/outliner.c') diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index 18ef168b7e6..565a4998c0e 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -842,9 +842,29 @@ static void outliner_build_tree(SpaceOops *soops) /* options */ if(soops->outlinevis == SO_LIBRARIES) { Library *lib; + for(lib= G.main->library.first; lib; lib= lib->id.next) { - outliner_add_element(soops, &soops->tree, lib, NULL, 0, 0); - } + ten= outliner_add_element(soops, &soops->tree, lib, NULL, 0, 0); + lib->id.newid= (ID *)ten; + } + /* make hierarchy */ + ten= soops->tree.first; + while(ten) { + TreeElement *nten= ten->next, *par; + tselem= TREESTORE(ten); + lib= (Library *)tselem->id; + if(lib->parent) { + BLI_remlink(&soops->tree, ten); + par= (TreeElement *)lib->parent->id.newid; + BLI_addtail(&par->subtree, ten); + ten->parent= par; + } + ten= nten; + } + /* restore newid pointers */ + for(lib= G.main->library.first; lib; lib= lib->id.next) + lib->id.newid= NULL; + } else if(soops->outlinevis == SO_ALL_SCENES) { Scene *sce; @@ -1637,9 +1657,9 @@ static int tree_element_type_active(SpaceOops *soops, TreeElement *te, TreeStore return 0; } +#ifdef WITH_VERSE static void verse_operation_menu(TreeElement *te) { -#ifdef WITH_VERSE short event=0; if(te->idcode==ID_VS) { struct VerseSession *session = (VerseSession*)te->directdata; @@ -1713,9 +1733,8 @@ static void verse_operation_menu(TreeElement *te) break; } } -#endif - } +#endif static int do_outliner_mouse_event(SpaceOops *soops, TreeElement *te, short event, float *mval) @@ -2711,7 +2730,7 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen case ID_GR: BIF_icon_draw(x, y, ICON_CIRCLE_DEHLT); break; case ID_LI: - BIF_icon_draw(x, y, ICON_PARLIB); break; + BIF_icon_draw(x, y, ICON_LIBRARY_DEHLT); break; } } } -- cgit v1.2.3