diff options
Diffstat (limited to 'intern/openvdb/intern')
-rw-r--r-- | intern/openvdb/intern/openvdb_dense_convert.cc | 3 | ||||
-rw-r--r-- | intern/openvdb/intern/openvdb_dense_convert.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/intern/openvdb/intern/openvdb_dense_convert.cc b/intern/openvdb/intern/openvdb_dense_convert.cc index d4f62776988..ef52408bd93 100644 --- a/intern/openvdb/intern/openvdb_dense_convert.cc +++ b/intern/openvdb/intern/openvdb_dense_convert.cc @@ -115,7 +115,8 @@ openvdb::GridBase *OpenVDB_export_vector_grid( vecgrid->setTransform(transform); - if (mask) { + /* Avoid clipping against an empty grid. */ + if (mask && !mask->tree().empty()) { vecgrid = tools::clip(*vecgrid, *mask); } diff --git a/intern/openvdb/intern/openvdb_dense_convert.h b/intern/openvdb/intern/openvdb_dense_convert.h index fd10334c4ad..284fd1ceeae 100644 --- a/intern/openvdb/intern/openvdb_dense_convert.h +++ b/intern/openvdb/intern/openvdb_dense_convert.h @@ -64,7 +64,8 @@ GridType *OpenVDB_export_grid( grid->setTransform(transform); - if (mask) { + /* Avoid clipping against an empty grid. */ + if (mask && !mask->tree().empty()) { grid = tools::clip(*grid, *mask); } |