forked from bartvdbraak/blender
Fix T82016: Cycles assert with empty OpenVDB volumes
This commit is contained in:
parent
3ffa0452af
commit
4dddd54393
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user