Packing Images fix:
- a 'procedural image' like 'UV Test Grid' now can be directly packed, it does ask first for confirming to pack it as PNG
This commit is contained in:
@@ -489,8 +489,10 @@ void BKE_image_memorypack(Image *ima)
|
||||
ibuf->encodedsize= 0;
|
||||
ibuf->userflags &= ~IB_BITMAPDIRTY;
|
||||
|
||||
if(ima->source==IMA_SRC_GENERATED)
|
||||
if(ima->source==IMA_SRC_GENERATED) {
|
||||
ima->source= IMA_SRC_FILE;
|
||||
ima->type= IMA_TYPE_IMAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1912,7 +1912,8 @@ void pack_image_sima()
|
||||
else {
|
||||
ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser);
|
||||
if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
|
||||
error("Can't pack painted image. Save image or use Repack as PNG.");
|
||||
if(okee("Can't pack painted image. Use Repack as PNG?"))
|
||||
BKE_image_memorypack(ima);
|
||||
}
|
||||
else {
|
||||
ima->packedfile = newPackedFile(ima->name);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ void image_buttons(void)
|
||||
if (ima->packedfile) {
|
||||
headerbuttons_packdummy = 1;
|
||||
}
|
||||
if (ima->packedfile && (ibuf->userflags & IB_BITMAPDIRTY))
|
||||
if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
|
||||
uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
|
||||
else
|
||||
uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
|
||||
|
||||
Reference in New Issue
Block a user