From 481cdb08ed6f33a09d0e6843d1024db93c301178 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 5 Jun 2018 15:10:33 +0200 Subject: Cleanup: use new accessors to blendfile path (Main.name). --- source/blender/editors/space_image/image_ops.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index dea1f761073..bfebc850b08 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -226,7 +226,7 @@ static int space_image_file_exists_poll(bContext *C) ibuf = ED_space_image_acquire_buffer(sima, &lock); if (ibuf) { BLI_strncpy(name, ibuf->name, FILE_MAX); - BLI_path_abs(name, bmain->name); + BLI_path_abs(name, BKE_main_blendfile_path(bmain)); if (BLI_exists(name) == false) { CTX_wm_operator_poll_msg_set(C, "image file not found"); @@ -1259,11 +1259,11 @@ static int image_open_exec(bContext *C, wmOperator *op) BLI_strncpy(filepath_range, frame_range->filepath, sizeof(filepath_range)); if (was_relative) { - BLI_path_rel(filepath_range, bmain->name); + BLI_path_rel(filepath_range, BKE_main_blendfile_path(bmain)); } Image *ima_range = image_open_single( - op, filepath_range, bmain->name, + op, filepath_range, BKE_main_blendfile_path(bmain), is_relative_path, use_multiview, frame_range_seq_len); /* take the first image */ @@ -1278,7 +1278,7 @@ static int image_open_exec(bContext *C, wmOperator *op) else { /* for drag & drop etc. */ ima = image_open_single( - op, filepath, bmain->name, + op, filepath, BKE_main_blendfile_path(bmain), is_relative_path, use_multiview, 1); } @@ -1686,12 +1686,12 @@ static int save_image_options_init(Main *bmain, SaveImageOptions *simopts, Space } else { BLI_strncpy(simopts->filepath, "//untitled", sizeof(simopts->filepath)); - BLI_path_abs(simopts->filepath, bmain->name); + BLI_path_abs(simopts->filepath, BKE_main_blendfile_path(bmain)); } } else { BLI_snprintf(simopts->filepath, sizeof(simopts->filepath), "//%s", ima->id.name + 2); - BLI_path_abs(simopts->filepath, is_prev_save ? G.ima : bmain->name); + BLI_path_abs(simopts->filepath, is_prev_save ? G.ima : BKE_main_blendfile_path(bmain)); } } @@ -1715,7 +1715,7 @@ static void save_image_options_from_op(Main *bmain, SaveImageOptions *simopts, w if (RNA_struct_property_is_set(op->ptr, "filepath")) { RNA_string_get(op->ptr, "filepath", simopts->filepath); - BLI_path_abs(simopts->filepath, bmain->name); + BLI_path_abs(simopts->filepath, BKE_main_blendfile_path(bmain)); } } @@ -2296,7 +2296,7 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; BLI_strncpy(name, ibuf->name, sizeof(name)); - BLI_path_abs(name, bmain->name); + BLI_path_abs(name, BKE_main_blendfile_path(bmain)); if (0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { BKE_reportf(op->reports, RPT_ERROR, "Could not write image: %s", strerror(errno)); -- cgit v1.2.3