diff options
author | Ton Roosendaal <ton@blender.org> | 2006-02-04 00:38:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-02-04 00:38:59 +0300 |
commit | 902bc75c345c6f2765db787b4304907e77bd2a50 (patch) | |
tree | 59b9ede4f1d438b8235c8ba415a1e8ff75f54073 | |
parent | 9facc0b20ef63ec97fa9c3de7dccaa2e49842f2c (diff) |
Render feature request; when saving EXR files during anim render, it can
optionally save a jpg next to it, with compression as set in buttons.
This allows quick previews or download from farms.
Button: next to the 'half' and 'zbuf' options for exr.
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 12 | ||||
-rw-r--r-- | source/blender/src/buttons_scene.c | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 9c1e2d3ec9a..ca6823bc959 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -447,6 +447,7 @@ typedef struct Scene { /* subimtype, flag options for imtype */ #define R_OPENEXR_HALF 1 #define R_OPENEXR_ZBUF 2 +#define R_PREVIEW_JPG 4 /* **************** SCENE ********************* */ diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 97e45abe596..83c0f88ae71 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1055,13 +1055,21 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra) ibuf->rect_float= rres.rectf; ibuf->zbuf_float= rres.rectz; ok= BKE_write_ibuf(ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality); - IMB_freeImBuf(ibuf); /* imbuf knows which rects are not part of ibuf */ - if(ok==0) { printf("Render error: cannot save %s\n", name); break; } else printf("Saved: %s", name); + + /* optional preview images for exr */ + if(ok && scene->r.imtype==R_OPENEXR && (scene->r.subimtype & R_PREVIEW_JPG)) { + if(BLI_testextensie(name, ".exr")) name[strlen(name)-4]= 0; + BKE_add_image_extension(name, R_JPEG90); + BKE_write_ibuf(ibuf, name, R_JPEG90, scene->r.subimtype, scene->r.quality); + printf("Saved: %s", name); + } + + IMB_freeImBuf(ibuf); /* imbuf knows which rects are not part of ibuf */ } BLI_timestr(re->i.lastframetime, name); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 43bcb30ecca..e4dc75a4131 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1268,8 +1268,7 @@ static void render_panel_format(void) #endif - uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format"); - uiDefButBitI(block, TOG, R_MOVIECROP, B_DIFF, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image"); + uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,225,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format"); yofs -= 22; @@ -1312,6 +1311,7 @@ static void render_panel_format(void) uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_NOP,"Half", 892,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Use 16 bits float 'Half' type"); uiDefButBitS(block, TOG, R_OPENEXR_ZBUF, B_NOP,"Zbuf", 952,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save the zbuffer as 32 bits unsigned int"); uiBlockEndAlign(block); + uiDefButBitS(block, TOG, R_PREVIEW_JPG, B_NOP,"Preview",1027,yofs+44,90,20, &G.scene->r.subimtype, 0, 0, 0, 0, "When animation render, save JPG preview images in same directory"); uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4", 892,yofs,112,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR"); |