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:
authorGaia Clary <gaia.clary@machinimatrix.org>2016-02-20 23:42:12 +0300
committerGaia Clary <gaia.clary@machinimatrix.org>2016-02-20 23:42:12 +0300
commit4e95807db3e17c647001ba4112371217d0d2506b (patch)
tree1b4e92587f2ce8d80d93806549f5a49bdba76e22
parentedf9e8d4dc676ea0789297369d4d78be8234f4ef (diff)
fix T47484: Added proper error reporting for Collada Exporter
-rw-r--r--source/blender/collada/DocumentExporter.cpp11
-rw-r--r--source/blender/collada/DocumentExporter.h2
-rw-r--r--source/blender/collada/collada.cpp4
-rw-r--r--source/blender/editors/io/io_collada.c4
4 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp
index 71c9391c6ac..90e53fe5eb0 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -178,7 +178,7 @@ static COLLADABU::NativeString make_temp_filepath(const char *name, const char *
// COLLADA allows this through multiple <channel>s in <animation>.
// For this to work, we need to know objects that use a certain action.
-void DocumentExporter::exportCurrentScene(Scene *sce)
+int DocumentExporter::exportCurrentScene(Scene *sce)
{
PointerRNA sceneptr, unit_settings;
PropertyRNA *system; /* unused , *scale; */
@@ -331,8 +331,13 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
// Finally move the created document into place
int status = BLI_rename(native_filename.c_str(), this->export_settings->filepath);
- fprintf(stdout, "Collada moved buffer : %s (Status: %d)\n", this->export_settings->filepath, status);
-
+ 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");
+ }
+ return status;
}
void DocumentExporter::exportScenes(const char *filename)
diff --git a/source/blender/collada/DocumentExporter.h b/source/blender/collada/DocumentExporter.h
index 84c0610282e..6e3c1ecd7cd 100644
--- a/source/blender/collada/DocumentExporter.h
+++ b/source/blender/collada/DocumentExporter.h
@@ -39,7 +39,7 @@ class DocumentExporter
{
public:
DocumentExporter(const ExportSettings *export_settings);
- void exportCurrentScene(Scene *sce);
+ int exportCurrentScene(Scene *sce);
void exportScenes(const char *filename);
private:
const ExportSettings *export_settings;
diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp
index 4ca21869ec2..b1cbc01a9a6 100644
--- a/source/blender/collada/collada.cpp
+++ b/source/blender/collada/collada.cpp
@@ -133,11 +133,11 @@ int collada_export(Scene *sce,
}
DocumentExporter exporter(&export_settings);
- exporter.exportCurrentScene(sce);
+ int status = exporter.exportCurrentScene(sce);
BLI_linklist_free(export_settings.export_set, NULL);
- return export_count;
+ return (status) ? -1:export_count;
}
/* end extern C */
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index d8f33dced13..d4c976fb544 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -175,6 +175,10 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_WARNING, "Export file is empty");
return OPERATOR_CANCELLED;
}
+ else if (export_count < 0) {
+ BKE_report(op->reports, RPT_WARNING, "Error during export (see Console)");
+ return OPERATOR_CANCELLED;
+ }
else {
char buff[100];
sprintf(buff, "Exported %d Objects", export_count);