[Bf-blender-cvs] [7d6c43785f4] soc-2020-info-editor: Merge branch 'master' into soc-2020-info-editor

Mateusz Grzeliński noreply at git.blender.org
Thu Aug 6 18:41:03 CEST 2020


Commit: 7d6c43785f44dc82de7bbb1482985736f6550c67
Author: Mateusz Grzeliński
Date:   Wed Aug 5 09:37:19 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB7d6c43785f44dc82de7bbb1482985736f6550c67

Merge branch 'master' into soc-2020-info-editor

# Conflicts:
#	source/blender/io/alembic/exporter/abc_export_capi.cc

===================================================================



===================================================================

diff --cc source/blender/io/alembic/exporter/abc_export_capi.cc
index 583c68cacf6,8c5f3d89870..872fd324a9a
--- a/source/blender/io/alembic/exporter/abc_export_capi.cc
+++ b/source/blender/io/alembic/exporter/abc_export_capi.cc
@@@ -103,17 -104,41 +104,41 @@@ static void export_startjob(void *custo
    const bool export_animation = (data->params.frame_start != data->params.frame_end);
  
    // Create the Alembic archive.
-   ABCArchive abc_archive(data->bmain, scene, data->params, std::string(data->filename));
+   std::unique_ptr<ABCArchive> abc_archive;
+   try {
+     abc_archive = std::make_unique<ABCArchive>(
+         data->bmain, scene, data->params, std::string(data->filename));
+   }
+   catch (const std::exception &ex) {
+     std::stringstream error_message_stream;
+     error_message_stream << "Error writing to " << data->filename;
+     const std::string &error_message = error_message_stream.str();
+ 
+     // The exception message can be very cryptic (just "iostream error" on Linux, for example), so
+     // better not to include it in the report.
+     CLOG_ERROR(&LOG, "%s: %s", error_message.c_str(), ex.what());
+     WM_report(RPT_ERROR, error_message.c_str());
+     data->export_ok = false;
+     return;
+   }
+   catch (...) {
+     // Unknown exception class, so we cannot include its message.
+     std::stringstream error_message_stream;
+     error_message_stream << "Unknown error writing to " << data->filename;
+     WM_report(RPT_ERROR, error_message_stream.str().c_str());
+     data->export_ok = false;
+     return;
+   }
  
-   ABCHierarchyIterator iter(data->depsgraph, &abc_archive, data->params);
+   ABCHierarchyIterator iter(data->depsgraph, abc_archive.get(), data->params);
  
    if (export_animation) {
 -    CLOG_INFO(&LOG, 2, "Exporting animation");
 +    CLOG_VERBOSE(&LOG, 2, "Exporting animation");
  
      // Writing the animated frames is not 100% of the work, but it's our best guess.
-     const float progress_per_frame = 1.0f / std::max(size_t(1), abc_archive.total_frame_count());
-     ABCArchive::Frames::const_iterator frame_it = abc_archive.frames_begin();
-     const ABCArchive::Frames::const_iterator frames_end = abc_archive.frames_end();
+     const float progress_per_frame = 1.0f / std::max(size_t(1), abc_archive->total_frame_count());
+     ABCArchive::Frames::const_iterator frame_it = abc_archive->frames_begin();
+     const ABCArchive::Frames::const_iterator frames_end = abc_archive->frames_end();
  
      for (; frame_it != frames_end; frame_it++) {
        double frame = *frame_it;
@@@ -127,8 -152,8 +152,8 @@@
        scene->r.subframe = frame - scene->r.cfra;
        BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain);
  
 -      CLOG_INFO(&LOG, 2, "Exporting frame %.2f", frame);
 +      CLOG_VERBOSE(&LOG, 2, "Exporting frame %.2f", frame);
-       ExportSubset export_subset = abc_archive.export_subset_for_frame(frame);
+       ExportSubset export_subset = abc_archive->export_subset_for_frame(frame);
        iter.set_export_subset(export_subset);
        iter.iterate_and_write();



More information about the Bf-blender-cvs mailing list