diff options
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index d58b78ff6a7..68f9e4d033e 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -960,20 +960,19 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, if(ibuf) { Image *ima= sima->image; - RenderResult *rr= BKE_image_acquire_renderresult(scene, ima); simopts->planes= ibuf->depth; - /* cant save multilayer sequence, ima->rr isn't valid for a specific frame */ - if(rr && !(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER)) - simopts->imtype= R_MULTILAYER; - else if(ima->type==IMA_TYPE_R_RESULT) + if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { simopts->imtype= scene->r.imtype; - else if (ima->source == IMA_SRC_GENERATED) + simopts->planes= scene->r.planes; + } + else if (ima->source == IMA_SRC_GENERATED) { simopts->imtype= R_PNG; - else + } + else { simopts->imtype= BKE_ftype_to_imtype(ibuf->ftype); - + } simopts->subimtype= scene->r.subimtype; /* XXX - this is lame, we need to make these available too! */ simopts->quality= ibuf->ftype & 0xff; @@ -1000,8 +999,6 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, } BLI_path_abs(simopts->filepath, G.main->name); } - /* cleanup */ - BKE_image_release_renderresult(scene, ima); } ED_space_image_release_buffer(sima, lock); @@ -1016,7 +1013,10 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op // if (RNA_property_is_set(op->ptr, "subimtype")) simopts->subimtype= RNA_enum_get(op->ptr, "subimtype"); // XXX if (RNA_property_is_set(op->ptr, "file_quality")) simopts->quality= RNA_int_get(op->ptr, "file_quality"); - if (RNA_property_is_set(op->ptr, "filepath")) RNA_string_get(op->ptr, "filepath", simopts->filepath); + if (RNA_property_is_set(op->ptr, "filepath")) { + RNA_string_get(op->ptr, "filepath", simopts->filepath); + BLI_path_abs(simopts->filepath, G.main->name); + } } static void save_image_options_to_op(SaveImageOptions *simopts, wmOperator *op) @@ -1069,7 +1069,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI Scene *scene= CTX_data_scene(C); RenderResult *rr= BKE_image_acquire_renderresult(scene, ima); if(rr) { - RE_WriteRenderResult(rr, simopts->filepath, simopts->quality); + RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->quality); ok= TRUE; } else { |