Fix #105546: Cycles volume uninitialized when frame is beyond valid range
Pull Request: https://projects.blender.org/blender/blender/pulls/139930
This commit is contained in:
committed by
Brecht Van Lommel
parent
8a7481b763
commit
44dc92bed6
@@ -198,6 +198,8 @@ static void sync_smoke_volume(
|
||||
ATTR_STD_VOLUME_VELOCITY,
|
||||
ATTR_STD_NONE};
|
||||
|
||||
int frame_interval[2] = {b_domain.cache_frame_start(), b_domain.cache_frame_end()};
|
||||
|
||||
for (int i = 0; attributes[i] != ATTR_STD_NONE; i++) {
|
||||
AttributeStandard std = attributes[i];
|
||||
if (!volume->need_attribute(scene, std)) {
|
||||
@@ -208,6 +210,11 @@ static void sync_smoke_volume(
|
||||
|
||||
Attribute *attr = volume->attributes.add(std);
|
||||
|
||||
if (frame < frame_interval[0] || frame > frame_interval[1]) {
|
||||
attr->data_voxel().clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
ImageLoader *loader = new BlenderSmokeLoader(b_ob_info.real_object, std);
|
||||
ImageParams params;
|
||||
params.frame = frame;
|
||||
|
||||
@@ -688,6 +688,10 @@ void GeometryManager::create_volume_mesh(const Scene *scene, Volume *volume, Pro
|
||||
|
||||
ImageHandle &handle = attr.data_voxel();
|
||||
|
||||
if (handle.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Try building from OpenVDB grid directly. */
|
||||
VDBImageLoader *vdb_loader = handle.vdb_loader();
|
||||
openvdb::GridBase::ConstPtr grid;
|
||||
|
||||
Reference in New Issue
Block a user