diff options
-rw-r--r-- | source/blender/blenkernel/intern/image_save.cc | 12 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index 6bfdaf9b522..9dda3762553 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -274,6 +274,12 @@ static void image_save_post(ReportList *reports, if (opts->do_newpath) { BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name)); BLI_strncpy(ima->filepath, filepath, sizeof(ima->filepath)); + + /* only image path, never ibuf */ + if (opts->relative) { + const char *relbase = ID_BLEND_PATH(opts->bmain, &ima->id); + BLI_path_rel(ima->filepath, relbase); /* only after saving */ + } } ibuf->userflags &= ~IB_BITMAPDIRTY; @@ -303,12 +309,6 @@ static void image_save_post(ReportList *reports, ima->type = IMA_TYPE_IMAGE; } - /* only image path, never ibuf */ - if (opts->relative) { - const char *relbase = ID_BLEND_PATH(opts->bmain, &ima->id); - BLI_path_rel(ima->filepath, relbase); /* only after saving */ - } - /* Update image file color space when saving to another color space. */ const bool linear_float_output = BKE_imtype_requires_linear_float(opts->im_format.imtype); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e5b30372758..3e7ea663fcc 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1810,7 +1810,6 @@ static void image_save_options_from_op(Main *bmain, ImageSaveOptions *opts, wmOp RNA_boolean_get(op->ptr, "copy")); opts->save_as_render = (RNA_struct_find_property(op->ptr, "save_as_render") && RNA_boolean_get(op->ptr, "save_as_render")); - opts->do_newpath = true; } static bool save_image_op( @@ -1847,6 +1846,8 @@ static ImageSaveData *image_save_as_init(bContext *C, wmOperator *op) return NULL; } + isd->opts.do_newpath = true; + if (!RNA_struct_property_is_set(op->ptr, "filepath")) { RNA_string_set(op->ptr, "filepath", isd->opts.filepath); } |