diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-07-01 22:18:55 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-07-02 20:01:53 +0300 |
commit | 82466ca2e55884c1942e18ee4cd4f563a18fe232 (patch) | |
tree | dc3829bac6a8e88728e4d469760b41677ee26d70 /intern/cycles | |
parent | 0c84939117449c30f57620ef196e3a94bb87fda2 (diff) |
Fix T89581: Cycles crash rendering some OpenVDB files with inactive voxels
Print an error message instead.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/image_vdb.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 { |