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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-31 19:35:14 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-31 19:35:14 +0300
commitf71efafe8fc43083dcf573d258a1a5511d522702 (patch)
tree5d8f5e32c6a6a8aa43cb8679230b756328d5d8ad /source/blender/editors/space_image
parentdf22cd9ce160457bda1a976da4dd6e7079f36865 (diff)
parentcfea9c261c2349e03c5ce38a04659479901ce815 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/editors/sculpt_paint/paint_image.c source/blender/editors/space_image/image_edit.c source/blender/editors/space_image/image_ops.c source/blender/makesrna/intern/rna_material.c source/blender/makesrna/intern/rna_sculpt_paint.c source/blender/makesrna/intern/rna_space.c source/blenderplayer/bad_level_call_stubs/stubs.c
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_edit.c1
-rw-r--r--source/blender/editors/space_image/image_ops.c23
2 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index c598e486a7e..19829517e00 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -41,6 +41,7 @@
#include "BKE_image.h"
#include "BKE_editmesh.h"
#include "BKE_library.h"
+#include "BKE_main.h"
#include "IMB_imbuf_types.h"
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 9b146644894..c8cec4c7306 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1627,7 +1627,7 @@ static char imtype_best_depth(ImBuf *ibuf, const char imtype)
}
}
-static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, Scene *scene,
+static int save_image_options_init(Main *bmain, SaveImageOptions *simopts, SpaceImage *sima, Scene *scene,
const bool guess_path, const bool save_as_render)
{
void *lock;
@@ -1692,12 +1692,12 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
}
else {
BLI_strncpy(simopts->filepath, "//untitled", sizeof(simopts->filepath));
- BLI_path_abs(simopts->filepath, G.main->name);
+ BLI_path_abs(simopts->filepath, bmain->name);
}
}
else {
BLI_snprintf(simopts->filepath, sizeof(simopts->filepath), "//%s", ima->id.name + 2);
- BLI_path_abs(simopts->filepath, is_prev_save ? G.ima : G.main->name);
+ BLI_path_abs(simopts->filepath, is_prev_save ? G.ima : bmain->name);
}
}
@@ -1711,7 +1711,7 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
return (ibuf != NULL);
}
-static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op)
+static void save_image_options_from_op(Main *bmain, SaveImageOptions *simopts, wmOperator *op)
{
if (op->customdata) {
BKE_color_managed_view_settings_free(&simopts->im_format.view_settings);
@@ -1721,7 +1721,7 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op
if (RNA_struct_property_is_set(op->ptr, "filepath")) {
RNA_string_get(op->ptr, "filepath", simopts->filepath);
- BLI_path_abs(simopts->filepath, G.main->name);
+ BLI_path_abs(simopts->filepath, bmain->name);
}
}
@@ -2054,6 +2054,7 @@ static void image_save_as_free(wmOperator *op)
static int image_save_as_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
SpaceImage *sima = CTX_wm_space_image(C);
SaveImageOptions simopts;
@@ -2061,9 +2062,9 @@ static int image_save_as_exec(bContext *C, wmOperator *op)
/* just in case to initialize values,
* these should be set on invoke or by the caller. */
- save_image_options_init(&simopts, sima, CTX_data_scene(C), false, false);
+ save_image_options_init(bmain, &simopts, sima, CTX_data_scene(C), false, false);
- save_image_options_from_op(&simopts, op);
+ save_image_options_from_op(bmain, &simopts, op);
save_image_doit(C, sima, op, &simopts, true);
@@ -2080,6 +2081,7 @@ static bool image_save_as_check(bContext *UNUSED(C), wmOperator *op)
static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
+ Main *bmain = CTX_data_main(C);
SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = ED_space_image(sima);
Scene *scene = CTX_data_scene(C);
@@ -2092,7 +2094,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS
save_image_options_defaults(&simopts);
- if (save_image_options_init(&simopts, sima, scene, true, save_as_render) == 0)
+ if (save_image_options_init(bmain, &simopts, sima, scene, true, save_as_render) == 0)
return OPERATOR_CANCELLED;
save_image_options_to_op(&simopts, op);
@@ -2203,14 +2205,15 @@ void IMAGE_OT_save_as(wmOperatorType *ot)
static int image_save_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
SpaceImage *sima = CTX_wm_space_image(C);
Scene *scene = CTX_data_scene(C);
SaveImageOptions simopts;
save_image_options_defaults(&simopts);
- if (save_image_options_init(&simopts, sima, scene, false, false) == 0)
+ if (save_image_options_init(bmain, &simopts, sima, scene, false, false) == 0)
return OPERATOR_CANCELLED;
- save_image_options_from_op(&simopts, op);
+ save_image_options_from_op(bmain, &simopts, op);
if (BLI_exists(simopts.filepath) && BLI_file_is_writable(simopts.filepath)) {
if (save_image_doit(C, sima, op, &simopts, false)) {