Page MenuHome

Crash when smoke type switch from Flow to Domain with Cycles viewport rendering
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: 67EF:CF ATI Technologies Inc. 4.5.13474 Core Profile Context 22.19.162.4

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
Crash when smoke type switch from Flow to Domain with Cycles viewport rendering.

Exact steps for others to reproduce the error

  1. Use Cycles
  2. Add Quick Smoke
  3. Change Smoke Type to Flow
  4. Swhitch viewport to Rendered
  5. Change Smoke Type to Domain
  6. Crash

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Aug 7 2019, 12:57 PM

Confirmed, checking...

Setting smoke type already does rna_Modifier_dependency_update and thus DEG_relations_tag_update(bmain), so not sure if there is more to be done on the blender side...

Crash is in cycles BVH refitting, if the BVH is rebuilt instead, all is fine...

quick proof: following seems to work, but there is probably a more elegant way to do this (or a completely other solution alltogether)...

1
2
3diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
4index c672bc9f3e2..ae789aaa47c 100644
5--- a/intern/cycles/blender/blender_mesh.cpp
6+++ b/intern/cycles/blender/blender_mesh.cpp
7@@ -1002,6 +1002,14 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
8 oldcurve_keys.steal_data(mesh->curve_keys);
9 oldcurve_radius.steal_data(mesh->curve_radius);
10
11+ /* ensure bvh rebuild if smoke type changed from flow to domain, not sure why... */
12+ bool oldhas_voxel_attributes = false;
13+ foreach (Attribute &attr, mesh->attributes.attributes) {
14+ if (attr.element == ATTR_ELEMENT_VOXEL) {
15+ oldhas_voxel_attributes = true;
16+ }
17+ }
18+
19 mesh->clear();
20 mesh->used_shaders = used_shaders;
21 mesh->name = ustring(b_ob_data.name().c_str());
22@@ -1048,9 +1056,17 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
23 sync_mesh_fluid_motion(b_ob, scene, mesh);
24
25 /* tag update */
26+ bool has_voxel_attributes = false;
27+ foreach (Attribute &attr, mesh->attributes.attributes) {
28+ if (attr.element == ATTR_ELEMENT_VOXEL) {
29+ has_voxel_attributes = true;
30+ }
31+ }
32+
33 bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != mesh->subd_faces) ||
34 (oldsubd_face_corners != mesh->subd_face_corners) ||
35- (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius);
36+ (oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius) ||
37+ (oldhas_voxel_attributes != has_voxel_attributes);
38
39 mesh->tag_update(scene, rebuild);
40

T58569 is the same thing really...