diff options
author | Ton Roosendaal <ton@blender.org> | 2006-09-06 13:51:30 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-09-06 13:51:30 +0400 |
commit | 02baf30e55b1159bb9e347998caaa8fac12afb81 (patch) | |
tree | 0580882d0f65b0d9e7ccb941aa46ae60f996a1ea /source/blender/src/outliner.c | |
parent | 6f47e5fa84f80739e5fb19e08cbe472eb42f7f32 (diff) |
New feature: imporant missing option for use of Libraries: access to to the
file path where library is read from.
In Outliner, choose new view mode "Libraries". A ctrl+click on the library
name then allows to change the file name or path. Note that when you change
the file name, nothing is being re-read or re-linked. Only after saving the
.blend file and reading it back the new library is used.
This feature allows to cleanup library usage. You can make files relative,
or reorganize a project. Just keep in mind that you cannot use this feature
to fix .blend files that link to non-existing other files. That because the
lost data is actually not read at all, so cannot be saved either.
Currently, library errors are only printed in the console... quite
important to keep track of when using Libraries.
Implementation note: this Outliner view mode can become expanded to a full
"Database view", showing something similar as SHIFT+F4 databrowse does now.
Diffstat (limited to 'source/blender/src/outliner.c')
-rw-r--r-- | source/blender/src/outliner.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c index 187106e79d6..e5c4797209a 100644 --- a/source/blender/src/outliner.c +++ b/source/blender/src/outliner.c @@ -399,7 +399,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->parent= parent; te->index= index; // for data arays - te->name= id->name+2; // default, can be overridden by non-ID data + te->name= id->name+2; // default, can be overridden by Library or non-ID data te->idcode= GS(id->name); if(type==0) { @@ -409,6 +409,9 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i /* expand specific data always */ switch(GS(id->name)) { + case ID_LI: + te->name= ((Library *)id)->name; + break; case ID_SCE: { Scene *sce= (Scene *)id; @@ -788,7 +791,6 @@ static void outliner_make_hierarchy(SpaceOops *soops, ListBase *lb) static void outliner_build_tree(SpaceOops *soops) { - Scene *sce; Base *base; Object *ob; TreeElement *te, *ten; @@ -804,8 +806,15 @@ static void outliner_build_tree(SpaceOops *soops) /* clear ob id.new flags */ for(ob= G.main->object.first; ob; ob= ob->id.next) ob->id.newid= NULL; - /* option 1: all scenes */ - if(soops->outlinevis == SO_ALL_SCENES) { + /* 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); + } + } + else if(soops->outlinevis == SO_ALL_SCENES) { + Scene *sce; for(sce= G.main->scene.first; sce; sce= sce->id.next) { te= outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0); tselem= TREESTORE(te); @@ -848,7 +857,7 @@ static void outliner_build_tree(SpaceOops *soops) for(go= group->gobject.first; go; go= go->next) { ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0); - ten->directdata= NULL; + ten->directdata= NULL; /* eh, why? */ } outliner_make_hierarchy(soops, &te->subtree); /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ @@ -2134,7 +2143,7 @@ void outliner_operation_menu(ScrArea *sa) { SpaceOops *soops= sa->spacedata.first; - // globals + // bad globals scenelevel= objectlevel= idlevel= datalevel=0; set_operation_types(soops, &soops->tree); @@ -2360,6 +2369,8 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen BIF_icon_draw(x, y, ICON_SCRIPT); break; case ID_GR: BIF_icon_draw(x, y, ICON_CIRCLE_DEHLT); break; + case ID_LI: + BIF_icon_draw(x, y, ICON_PARLIB); break; } } } @@ -2739,6 +2750,7 @@ static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb) if(tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name); else if (tselem->type==TSE_MODIFIER) len = sizeof(((ModifierData*) 0)->name); + else if(tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name); else len= sizeof(((ID*) 0)->name)-2; dx= BIF_GetStringWidth(G.font, te->name, 0); |