Merge branch 'blender-v2.91-release'

This commit is contained in:
Brecht Van Lommel 2020-11-04 16:07:03 +01:00
commit b63490bc4b
1 changed files with 6 additions and 1 deletions

View File

@ -438,10 +438,15 @@ static openvdb::GridBase::ConstPtr openvdb_grid_from_device_texture(device_textu
image_memory->data_width - 1,
image_memory->data_height - 1,
image_memory->data_depth - 1);
typename GridType::Ptr sparse = GridType::create(ValueType(0.0f));
if (dense_bbox.empty()) {
return sparse;
}
openvdb::tools::Dense<ValueType, openvdb::tools::MemoryLayout::LayoutXYZ> dense(
dense_bbox, static_cast<ValueType *>(image_memory->host_pointer));
typename GridType::Ptr sparse = GridType::create(ValueType(0.0f));
openvdb::tools::copyFromDense(dense, *sparse, ValueType(volume_clipping));
/* #copyFromDense will remove any leaf node that contains constant data and replace it with a