[Bf-blender-cvs] [eba6900b083] master: Fix T98305: Image.save not working for generated images with filepath

Brecht Van Lommel noreply at git.blender.org
Mon May 23 12:44:44 CEST 2022


Commit: eba6900b083e78b70c328783382f99bb18da6099
Author: Brecht Van Lommel
Date:   Mon May 23 12:06:07 2022 +0200
Branches: master
https://developer.blender.org/rBeba6900b083e78b70c328783382f99bb18da6099

Fix T98305: Image.save not working for generated images with filepath

This is a place where the API function and operator should differ, for the API
manually setting the filepath and then saving should work. For the UI there is
no filepath visible, so it should open Save As even if there was a filepath set
for example from before changing an image type to Generated.

===================================================================

M	source/blender/blenkernel/intern/image_save.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc
index 0230cf89d06..b67d3490e03 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -143,7 +143,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
 
     opts->im_format.color_management = R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE;
 
-    if (ima->source == IMA_SRC_TILED) {
+    if (ibuf->name[0] == '\0' || ima->source == IMA_SRC_TILED) {
       BLI_strncpy(opts->filepath, ima->filepath, sizeof(opts->filepath));
       BLI_path_abs(opts->filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id));
     }



More information about the Bf-blender-cvs mailing list