diff options
-rw-r--r-- | source/blender/blenkernel/BKE_library.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 1 | ||||
-rw-r--r-- | source/blender/src/header_oops.c | 5 | ||||
-rw-r--r-- | source/blender/src/outliner.c | 24 |
6 files changed, 31 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index ac438ec95bd..c51ebe25226 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -50,6 +50,8 @@ void id_us_plus(struct ID *id); int new_id(struct ListBase *lb, struct ID *id, const char *name); struct ListBase *wich_libbase(struct Main *mainlib, short type); + +#define MAX_LIBARRAY 40 int set_listbasepointers(struct Main *main, struct ListBase **lb); void free_libblock(struct ListBase *lb, void *idv); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 5628e4bc491..2917853b72d 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -114,7 +114,6 @@ #include "BPI_script.h" #define MAX_IDPUP 60 /* was 24 */ -#define MAX_LIBARRAY 100 /* was 30, warning: used it readfile.c too */ /* ************* general ************************ */ @@ -201,6 +200,7 @@ ListBase *wich_libbase(Main *mainlib, short type) return 0; } +/* note: MAX_LIBARRAY define should match this code */ int set_listbasepointers(Main *main, ListBase **lb) { /* BACKWARDS! also watch order of free-ing! (mesh<->mat) */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 09b040be731..6ece27c2e46 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -384,7 +384,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist); static void add_main_to_main(Main *mainvar, Main *from) { - ListBase *lbarray[100], *fromarray[100]; // define in library.c too + ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY]; int a; a= set_listbasepointers(mainvar, lbarray); @@ -434,7 +434,7 @@ static void split_libdata(ListBase *lb, Main *first) void blo_split_main(ListBase *mainlist) { Main *mainl= mainlist->first; - ListBase *lbarray[30]; + ListBase *lbarray[MAX_LIBARRAY]; Library *lib; int i; @@ -6260,7 +6260,7 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd) static void expand_main(FileData *fd, Main *mainvar) { - ListBase *lbarray[30]; + ListBase *lbarray[MAX_LIBARRAY]; ID *id; int a, doit= 1; @@ -6643,7 +6643,7 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode) static int mainvar_count_libread_blocks(Main *mainvar) { - ListBase *lbarray[30]; + ListBase *lbarray[MAX_LIBARRAY]; int a, tot= 0; a= set_listbasepointers(mainvar, lbarray); @@ -6661,7 +6661,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) { Main *mainl= mainlist->first; Main *mainptr; - ListBase *lbarray[30]; + ListBase *lbarray[MAX_LIBARRAY]; int a, doit= 1; while(doit) { diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index c885c709c0e..6f21eb86f56 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -526,6 +526,7 @@ typedef struct SpaceImaSel { #define SO_ACTIVE 4 #define SO_SAME_TYPE 5 #define SO_GROUPS 6 +#define SO_LIBRARIES 7 /* SpaceOops->storeflag */ #define SO_TREESTORE_CLEANUP 1 diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c index f84cee782d7..98dbced9dbd 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -477,7 +477,10 @@ void oops_buttons(void) } #endif else { - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); + if(G.main->library.first) + uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); + else + uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); } /* always do as last */ 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); |