Using linked library files with relative paths, didn't set the correct
relative root... so it only worked with files in the same directory.
ALso fixed the button-lock in material buttons, it didn't allow to see
which materials were linked to the mesh/object.
This commit is contained in:
Ton Roosendaal 2005-07-10 11:00:27 +00:00
parent 65c9ea4588
commit 227a67e105
3 changed files with 14 additions and 4 deletions

@ -5564,7 +5564,7 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
sfile->libfiledata= 0;
}
if(sfile->flag & FILE_STRINGCODE) BLI_makestringcode(G.sce, mainl->curlib->name);
if(sfile->flag & FILE_STRINGCODE) BLI_makestringcode(filename, mainl->curlib->name); // uses old .blend file as reference
if(sfile->flag & FILE_ATCURSOR) {
centerbase= (G.scene->base.first);

@ -3112,6 +3112,7 @@ static void material_panel_material(Object *ob, Material *ma)
uiDefIconBut(block, BUT, B_MATCOPY, ICON_COPYUP, 262,200,XIC,YIC, 0, 0, 0, 0, 0, "Copies Material to the buffer");
uiSetButLock(id && id->lib, "Can't edit library data");
uiDefIconBut(block, BUT, B_MATPASTE, ICON_PASTEUP, 283,200,XIC,YIC, 0, 0, 0, 0, 0, "Pastes Material from the buffer");
uiClearButLock();
if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */
@ -3143,10 +3144,10 @@ static void material_panel_material(Object *ob, Material *ma)
uiBlockEndAlign(block);
if(ob->totcol==0) return;
uiSetButLock(id->lib!=0, "Can't edit library data");
ma= give_current_material(ob, ob->actcol);
if(ma==0) return;
if(ma==NULL) return;
uiSetButLock(ma->id.lib!=NULL, "Can't edit library data");
if(ma->dynamode & MA_DRAW_DYNABUTS) {
uiBlockBeginAlign(block);
@ -3264,6 +3265,8 @@ void material_panels()
material_panel_material(ob, ma);
if(ma) {
uiSetButLock(ma->id.lib!=NULL, "Can't edit library data");
material_panel_ramps(ma);
material_panel_shading(ma);
if (G.scene->r.renderer==R_INTERN)

@ -486,7 +486,14 @@ int uiNewPanel(ScrArea *sa, uiBlock *block, char *panelname, char *tabname, int
pa= pa->next;
}
if(pa==NULL) {
if(pa) {
if(pa->sizex != sizex) {
pa->sizex= sizex;
pa->ofsy+= (pa->sizey - sizey); // check uiNewPanelHeight()
pa->sizey= sizey;
}
}
else {
/* new panel */
pa= MEM_callocN(sizeof(Panel), "new panel");