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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-03 03:36:31 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-03 03:36:31 +0400
commit893cd1b4fd13b3324f383363bebd466ba04b376e (patch)
treec624c21a027101417c38f1f4d742365a903793e7 /source/blender/windowmanager
parent6f0cb140b0af6c7af6d2bce61db596975ad967c5 (diff)
Fix #31253: collada export default file name now is no longer always
untitled.dae, but rather uses .blend file name like other exporters. Patch by Gaia Clary.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 1de8c95fcce..a38ee5afe15 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2132,7 +2132,12 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
{
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];
- BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+
+ if (G.main->name[0] == 0)
+ BLI_strncpy(filepath, "untitled", sizeof(filepath));
+ else
+ BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+
BLI_replace_extension(filepath, sizeof(filepath), ".dae");
RNA_string_set(op->ptr, "filepath", filepath);
}