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.
This commit is contained in:
2012-05-02 23:36:31 +00:00
parent 6f0cb140b0
commit 893cd1b4fd

View File

@@ -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);
}