Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-21 18:09:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-21 18:09:45 +0400
commit8eb594b74be479eda1cddc28291d7df27aa70dd5 (patch)
tree6683ee4ba6e1efeeb899d2abc3d3873548dfb238 /source/blender/editors/space_image/image_ops.c
parent9d0a67fdc41830f75851e9f0154271a25721fe1f (diff)
Fix #22870: Can't save modified non-packed images. File exist check
wasn't taking into account that there could be relative paths.
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3e269634b27..03fc7dad016 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -127,10 +127,15 @@ static int space_image_file_exists_poll(bContext *C)
SpaceImage *sima= CTX_wm_space_image(C);
ImBuf *ibuf;
void *lock;
- int poll;
-
+ int poll= 0;
+ char name[FILE_MAX];
+
ibuf= ED_space_image_acquire_buffer(sima, &lock);
- poll= (ibuf && BLI_exists(ibuf->name) && BLI_is_writable(ibuf->name));
+ if(ibuf) {
+ BLI_strncpy(name, ibuf->name, FILE_MAX);
+ BLI_path_abs(name, G.sce);
+ poll= (BLI_exists(name) && BLI_is_writable(name));
+ }
ED_space_image_release_buffer(sima, lock);
return poll;
@@ -1030,6 +1035,8 @@ static int save_exec(bContext *C, wmOperator *op)
BLI_strncpy(name, ibuf->name, FILE_MAX);
if(name[0]==0)
BLI_strncpy(name, G.ima, FILE_MAX);
+ else
+ BLI_path_abs(name, G.sce);
if(BLI_exists(name) && BLI_is_writable(name)) {
rr= BKE_image_acquire_renderresult(scene, ima);