Commit: 82466ca2e55884c1942e18ee4cd4f563a18fe232
Author: Brecht Van Lommel
Date:   Thu Jul 1 21:18:55 2021 +0200
Branches: master
https://developer.blender.org/rB82466ca2e55884c1942e18ee4cd4f563a18fe232

Fix T89581: Cycles crash rendering some OpenVDB files with inactive voxels

Print an error message instead.

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

M       intern/cycles/render/image_vdb.cpp

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

diff --git a/intern/cycles/render/image_vdb.cpp 
b/intern/cycles/render/image_vdb.cpp
index 13cdda552ba..6202035ba3b 100644
--- a/intern/cycles/render/image_vdb.cpp
+++ b/intern/cycles/render/image_vdb.cpp
@@ -16,6 +16,7 @@
 
 #include "render/image_vdb.h"
 
+#include "util/util_logging.h"
 #include "util/util_openvdb.h"
 
 #ifdef WITH_OPENVDB
@@ -61,7 +62,13 @@ struct ToNanoOp {
   bool operator()(const openvdb::GridBase::ConstPtr &grid)
   {
     if constexpr (!std::is_same_v<GridType, openvdb::MaskGrid>) {
-      nanogrid = 
nanovdb::openToNanoVDB(FloatGridType(*openvdb::gridConstPtrCast<GridType>(grid)));
+      try {
+        nanogrid = nanovdb::openToNanoVDB(
+            FloatGridType(*openvdb::gridConstPtrCast<GridType>(grid)));
+      }
+      catch (const std::exception &e) {
+        VLOG(1) << "Error converting OpenVDB to NanoVDB grid: " << e.what();
+      }
       return true;
     }
     else {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to