diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-03-07 00:47:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-03-07 00:47:16 +0300 |
commit | 3838b80cf1cfe0a340a8471732bc86fde2852c29 (patch) | |
tree | 2f49637004aee3b734abca6fbaefd63f385dd93b /source/blender/makesrna/intern/rna_image_api.c | |
parent | 782cb1f0e0d9c019bfb7b9391ffa4b827ed1aa6f (diff) |
re-project + gimp integration, now its easy to edit the view in the gimp and apply the projection back without manually opening and saving files.
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index f2dbc7ef23f..ef7fa3360d4 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -40,6 +40,7 @@ #include "BKE_packedFile.h" #include "BKE_main.h" #include "BKE_utildefines.h" +#include "BKE_global.h" /* grr: G.sce */ #include "IMB_imbuf.h" @@ -84,12 +85,21 @@ static void rna_Image_save(Image *image, ReportList *reports) { ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); if(ibuf) { + char filename[FILE_MAXDIR + FILE_MAXFILE]; + BLI_strncpy(filename, image->name, sizeof(filename)); + BLI_convertstringcode(filename, G.sce); + if(image->packedfile) { if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) { BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name+2, image->name); } } - else if (IMB_saveiff(ibuf, image->name, ibuf->flags)) { + else if (IMB_saveiff(ibuf, filename, ibuf->flags)) { + image->type= IMA_TYPE_IMAGE; + + if(image->source==IMA_SRC_GENERATED) + image->source= IMA_SRC_FILE; + ibuf->userflags &= ~IB_BITMAPDIRTY; } else { |