1
1

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

Print an error message instead.
This commit is contained in:
2021-07-01 21:18:55 +02:00
parent 0c84939117
commit 82466ca2e5

View File

@@ -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 {