Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-08-14 11:48:25 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-08-14 11:54:28 +0300
commitb4051db4fc3ae509aa65f96af348f8241ceb726f (patch)
treee64ffc7f1cc18dd3e50ef03ee5f09f55c4f891b3 /intern/cycles/blender/blender_mesh.cpp
parent7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14 (diff)
Fix cycles crash when voxel attributes changed
This could happen e.g. when changing smoke type from flow to domain or connecting a volume shader with to a domain without an actual flow type around. Fixes T58569, T68359 Reviewers: brecht Maniphest Tasks: T58569, T68359 Differential Revision: https://developer.blender.org/D5478
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r--intern/cycles/blender/blender_mesh.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index c672bc9f3e2..551866f7fce 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1002,6 +1002,9 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
oldcurve_keys.steal_data(mesh->curve_keys);
oldcurve_radius.steal_data(mesh->curve_radius);
+ /* ensure bvh rebuild (instead of refit) if has_voxel_attributes() changed */
+ bool oldhas_voxel_attributes = mesh->has_voxel_attributes();
+
mesh->clear();
mesh->used_shaders = used_shaders;
mesh->name = ustring(b_ob_data.name().c_str());
@@ -1050,7 +1053,8 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
/* tag update */
bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != mesh->subd_faces) ||
(oldsubd_face_corners != mesh->subd_face_corners) ||
- (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius);
+ (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius) ||
+ (oldhas_voxel_attributes != mesh->has_voxel_attributes());
mesh->tag_update(scene, rebuild);