IRC reported bug:

When linking a referenced (Library) Image to a texture face, it wasn't
tagged to become saved in file. So you lost data.

Also fixed: tooltip for the "Li" icons was wrong.
This commit is contained in:
Ton Roosendaal
2006-11-27 13:00:50 +00:00
parent 3ccfa7709e
commit 2e0084c2d9
4 changed files with 10 additions and 7 deletions

View File

@@ -140,7 +140,7 @@ Image *add_image(char *name)
if( strcmp(strtest, str)==0 ) { if( strcmp(strtest, str)==0 ) {
if(ima->anim==0 || ima->id.us==0) { if(ima->anim==0 || ima->id.us==0) {
strcpy(ima->name, name); /* for stringcode */ strcpy(ima->name, name); /* for stringcode */
ima->id.us++; ima->id.us++; /* officially should not, it doesn't link here! */
ima->ok= 1; ima->ok= 1;
return ima; return ima;
} }

View File

@@ -331,7 +331,8 @@ void image_changed(SpaceImage *sima, int dotile)
if(sima->image->tpageflag & IMA_TILES) tface->mode |= TF_TILES; if(sima->image->tpageflag & IMA_TILES) tface->mode |= TF_TILES;
else tface->mode &= ~TF_TILES; else tface->mode &= ~TF_TILES;
if(sima->image->id.us==0) sima->image->id.us= 1; if(sima->image->id.us==0) id_us_plus(&sima->image->id);
else id_lib_extern(&sima->image->id);
} }
} }
tface++; tface++;
@@ -2201,7 +2202,7 @@ static ScrArea *imagewindow_set_render_display(void)
sima->image= ima; sima->image= ima;
} }
else if(sima->image->id.us==0) /* well... happens on reload, dunno yet what todo, imagewindow cannot be user when hidden*/ else if(sima->image->id.us==0) /* well... happens on reload, dunno yet what todo, imagewindow cannot be user when hidden*/
sima->image->id.us= 1; id_us_plus(&sima->image->id);
/* this enforces reading empty buffer in what_image(), so display is cleared */ /* this enforces reading empty buffer in what_image(), so display is cleared */
IMB_freeImBuf(sima->image->ibuf); IMB_freeImBuf(sima->image->ibuf);

View File

@@ -1560,7 +1560,7 @@ static void image_replace(Image *old, Image *new)
me= G.main->mesh.first; me= G.main->mesh.first;
while(me) { while(me) {
if(me->mtface) { if(me->id.lib==NULL && me->mtface) {
tface= me->mtface; tface= me->mtface;
a= me->totface; a= me->totface;
while(a--) { while(a--) {
@@ -1575,7 +1575,9 @@ static void image_replace(Image *old, Image *new)
} }
if(rep) { if(rep) {
if(new->id.us==0) new->id.us= 1; if(new->id.us==0) id_us_plus(&new->id);
else id_lib_extern(&new->id);
} }
else error("Nothing replaced"); else error("Nothing replaced");
} }

View File

@@ -334,8 +334,8 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
if(id->lib) { if(id->lib) {
if(parid && parid->lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Displays name of the current Indirect Library Datablock. Click to change."); if(id->flag & LIB_INDIRECT) uiDefIconBut(block, BUT, 0, ICON_DATALIB,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Indirect Library Datablock. Cannot change.");
else uiDefIconBut(block, BUT, lib, ICON_PARLIB, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Displays current Library Datablock name. Click to make local."); else uiDefIconBut(block, BUT, lib, ICON_PARLIB, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Direct linked Library Datablock. Click to make local.");
xco+= XIC; xco+= XIC;
} }