diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 06:01:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 06:01:23 +0400 |
commit | 4ff038c4119327f3b0c472b71356d5e0cf2e0ed6 (patch) | |
tree | 395b8be489c012d9e2cf55d11a69303544bb6d68 /source/blender/editors/space_image | |
parent | b374d9b20fc7b5e320da4c00ba7e21976da6b0d3 (diff) |
screenshot operator now adds file extension in the file selector and has its own save options rather then using the render options (works like image save a copy).
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8b1ff4136b9..2c688990a8f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1001,11 +1001,7 @@ typedef struct { static void save_image_options_defaults(SaveImageOptions *simopts) { - memset(&simopts->im_format, 0, sizeof(simopts->im_format)); - simopts->im_format.planes = R_IMF_PLANES_RGB; - simopts->im_format.imtype = R_IMF_IMTYPE_PNG; - simopts->im_format.quality = 90; - simopts->im_format.compress = 90; + BKE_imformat_defaults(&simopts->im_format); simopts->filepath[0] = '\0'; } @@ -1246,13 +1242,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op) static int image_save_as_check(bContext *UNUSED(C), wmOperator *op) { ImageFormatData *imf = op->customdata; - char filepath[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", filepath); - if (BKE_add_image_extension(filepath, imf->imtype)) { - RNA_string_set(op->ptr, "filepath", filepath); - return TRUE; - } - return FALSE; + return WM_operator_filesel_ensure_ext_imtype(op, imf->imtype); } static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) |