diff --git a/intern/cycles/blender/volume.cpp b/intern/cycles/blender/volume.cpp index ae815afbffb..4c50ddef792 100644 --- a/intern/cycles/blender/volume.cpp +++ b/intern/cycles/blender/volume.cpp @@ -200,6 +200,8 @@ static void sync_smoke_volume( ATTR_STD_VOLUME_VELOCITY, ATTR_STD_NONE}; + const Interval frame_interval = {b_domain.cache_frame_start(), b_domain.cache_frame_end()}; + for (int i = 0; attributes[i] != ATTR_STD_NONE; i++) { const AttributeStandard std = attributes[i]; if (!volume->need_attribute(scene, std)) { @@ -210,6 +212,11 @@ static void sync_smoke_volume( Attribute *attr = volume->attributes.add(std); + if (!frame_interval.contains(frame)) { + attr->data_voxel().clear(); + continue; + } + unique_ptr loader = make_unique(b_ob_info.real_object, std); ImageParams params; params.frame = frame; diff --git a/intern/cycles/scene/volume.cpp b/intern/cycles/scene/volume.cpp index 1c735c15265..f5742f7f0f4 100644 --- a/intern/cycles/scene/volume.cpp +++ b/intern/cycles/scene/volume.cpp @@ -677,6 +677,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;