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-06-05 18:02:50 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-05 18:02:50 +0300
commitf0d9dbae0dae4deae84824833096c38e625073cb (patch)
treea9fa826eb5860e9b62d16c3498703bde1bb5d4aa /source/blender/editors/io
parentce6db959c7d96792edad3a6d606e3662a4ef0798 (diff)
parent481cdb08ed6f33a09d0e6843d1024db93c301178 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/intern/blendfile.c source/blender/blenloader/intern/readfile.h source/blender/blenloader/intern/versioning_250.c source/blender/blenloader/intern/versioning_260.c source/blender/blenloader/intern/versioning_270.c source/blender/blenloader/intern/versioning_legacy.c source/blender/editors/render/render_shading.c source/blender/makesrna/intern/rna_movieclip.c source/blender/render/intern/source/pipeline.c source/blender/render/intern/source/voxeldata.c
Diffstat (limited to 'source/blender/editors/io')
-rw-r--r--source/blender/editors/io/io_alembic.c8
-rw-r--r--source/blender/editors/io/io_cache.c2
-rw-r--r--source/blender/editors/io/io_collada.c7
3 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index b584782e183..4440b99f211 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -79,11 +79,11 @@ static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *
Main *bmain = CTX_data_main(C);
char filepath[FILE_MAX];
- if (bmain->name[0] == '\0') {
+ if (BKE_main_blendfile_path(bmain)[0] == '\0') {
BLI_strncpy(filepath, "untitled", sizeof(filepath));
}
else {
- BLI_strncpy(filepath, bmain->name, sizeof(filepath));
+ BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
}
BLI_replace_extension(filepath, sizeof(filepath), ".abc");
@@ -422,12 +422,12 @@ static int get_sequence_len(char *filename, int *ofs)
}
char path[FILE_MAX];
- BLI_path_abs(filename, G.main->name);
+ BLI_path_abs(filename, BKE_main_blendfile_path_from_global());
BLI_split_dir_part(filename, path, FILE_MAX);
if (path[0] == '\0') {
/* The filename had no path, so just use the blend file path. */
- BLI_split_dir_part(G.main->name, path, FILE_MAX);
+ BLI_split_dir_part(BKE_main_blendfile_path_from_global(), path, FILE_MAX);
}
DIR *dir = opendir(path);
diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c
index eb79d0bec13..b13eaced843 100644
--- a/source/blender/editors/io/io_cache.c
+++ b/source/blender/editors/io/io_cache.c
@@ -60,7 +60,7 @@ static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent *eve
char filepath[FILE_MAX];
Main *bmain = CTX_data_main(C);
- BLI_strncpy(filepath, bmain->name, sizeof(filepath));
+ BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
BLI_replace_extension(filepath, sizeof(filepath), ".abc");
RNA_string_set(op->ptr, "filepath", filepath);
}
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index bb0280875bd..c847974fc71 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -61,13 +61,16 @@
static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
+ Main *bmain = CTX_data_main(C);
+
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];
+ const char *blendfile_path = BKE_main_blendfile_path(bmain);
- if (G.main->name[0] == 0)
+ if (blendfile_path[0] == '\0')
BLI_strncpy(filepath, "untitled", sizeof(filepath));
else
- BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+ BLI_strncpy(filepath, blendfile_path, sizeof(filepath));
BLI_replace_extension(filepath, sizeof(filepath), ".dae");
RNA_string_set(op->ptr, "filepath", filepath);