diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-05-16 14:42:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-05-16 16:20:23 +0300 |
commit | 29a3f43da5d3423769f4871baad900a6e2f68942 (patch) | |
tree | 833a6fbb5d76a910fe3d051471b530f518123ac6 /source/blender/editors | |
parent | adf183eeaeaba4eeeea31353e4a939f7a5c5c9fc (diff) |
Python API: make Image.save and Image.save_render more consistent with operator
Previously these only supported a subset of what the save operator could do,
for example no multilayer or stereo saving, no proper color management. Now
share code with the image save operator so it's more consistent.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 01be2ef22d5..336331e44e7 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1722,13 +1722,12 @@ static ImageSaveData *image_save_as_init(bContext *C, wmOperator *op) Image *image = image_from_context(C); ImageUser *iuser = image_user_from_context(C); Scene *scene = CTX_data_scene(C); - const bool save_as_render = (image->source == IMA_SRC_VIEWER); ImageSaveData *isd = MEM_callocN(sizeof(*isd), __func__); isd->image = image; isd->iuser = iuser; - if (!BKE_image_save_options_init(&isd->opts, bmain, scene, image, iuser, true, save_as_render)) { + if (!BKE_image_save_options_init(&isd->opts, bmain, scene, image, iuser, true)) { BKE_image_save_options_free(&isd->opts); MEM_freeN(isd); return NULL; @@ -1995,7 +1994,7 @@ static int image_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - if (!BKE_image_save_options_init(&opts, bmain, scene, image, iuser, false, false)) { + if (!BKE_image_save_options_init(&opts, bmain, scene, image, iuser, false)) { BKE_image_save_options_free(&opts); return OPERATOR_CANCELLED; } @@ -2267,7 +2266,7 @@ bool ED_image_save_all_modified(const bContext *C, ReportList *reports) if (image_has_valid_path(ima)) { ImageSaveOptions opts; Scene *scene = CTX_data_scene(C); - if (!BKE_image_save_options_init(&opts, bmain, scene, ima, NULL, false, false)) { + if (!BKE_image_save_options_init(&opts, bmain, scene, ima, NULL, false)) { bool saved_successfully = BKE_image_save(reports, bmain, ima, NULL, &opts); ok = ok && saved_successfully; } |