diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 16:10:33 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 17:33:46 +0300 |
commit | 481cdb08ed6f33a09d0e6843d1024db93c301178 (patch) | |
tree | 77166d130bfff2d5dca884676aaeff6bc0758f96 /source/blender/editors/space_buttons | |
parent | 1d97e948d2c4867306e7fb5ce5fccf8b72c13391 (diff) |
Cleanup: use new accessors to blendfile path (Main.name).
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 813f4202a49..47f97b8087f 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -102,6 +102,7 @@ typedef struct FileBrowseOp { static int file_browse_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); FileBrowseOp *fbo = op->customdata; ID *id; char *str, path[FILE_MAX]; @@ -118,14 +119,14 @@ static int file_browse_exec(bContext *C, wmOperator *op) id = fbo->ptr.id.data; BLI_strncpy(path, str, FILE_MAX); - BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name); + BLI_path_abs(path, id ? ID_BLEND_PATH(bmain, id) : BKE_main_blendfile_path(bmain)); if (BLI_is_dir(path)) { /* do this first so '//' isnt converted to '//\' on windows */ BLI_add_slash(path); if (is_relative) { BLI_strncpy(path, str, FILE_MAX); - BLI_path_rel(path, G.main->name); + BLI_path_rel(path, BKE_main_blendfile_path(bmain)); str = MEM_reallocN(str, strlen(path) + 2); BLI_strncpy(str, path, FILE_MAX); } |