diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2016-02-21 01:26:33 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2016-02-21 01:26:33 +0300 |
commit | d2c59598341b41efb0e5d4620db20e129f7c999a (patch) | |
tree | 1da3a722db9139cc375562104e0aed594b21a919 /source/blender/collada | |
parent | 4e95807db3e17c647001ba4112371217d0d2506b (diff) |
fix T47484: Added fallback solution (copy exported file when rename is not supported)
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/DocumentExporter.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index 90e53fe5eb0..15e95a05425 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -133,6 +133,7 @@ extern bool bc_has_object_type(LinkNode *export_set, short obtype); #include "LightExporter.h" #include "MaterialExporter.h" +#include <errno.h> char *bc_CustomData_get_layer_name(const struct CustomData *data, int type, int n) { @@ -188,8 +189,6 @@ int DocumentExporter::exportCurrentScene(Scene *sce) COLLADABU::NativeString native_filename = make_temp_filepath(NULL, ".dae"); COLLADASW::StreamWriter *writer = new COLLADASW::StreamWriter(native_filename); - fprintf(stdout, "Collada export buffer: %s\n", native_filename.c_str()); - // open <collada> writer->startDocument(); @@ -330,12 +329,11 @@ int DocumentExporter::exportCurrentScene(Scene *sce) delete writer; // Finally move the created document into place + fprintf(stdout, "Collada export to: %s\n", this->export_settings->filepath); int status = BLI_rename(native_filename.c_str(), this->export_settings->filepath); - if (status != 0) - { - fprintf(stdout, "Collada: Can't move buffer %s\n", native_filename.c_str()); - fprintf(stdout, " to its destination %s\n", this->export_settings->filepath); - fprintf(stdout, "Reason : %s\n", errno ? strerror(errno) : "unknown error"); + if (status != 0) { + status = BLI_copy(native_filename.c_str(), this->export_settings->filepath); + BLI_delete(native_filename.c_str(), false, false); } return status; } |