Crash when smoke type switch from Flow to Domain with Cycles viewport rendering #68359

Closed
opened 2019-08-07 12:18:21 +02:00 by Kinouti Takahiro · 10 comments

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: f6cb5f5449
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
**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: `f6cb5f5449` 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

Added subscriber: @dskjal-1

Added subscriber: @dskjal-1
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Confirmed, checking...

Confirmed, checking...
Brecht Van Lommel was assigned by Philipp Oeser 2019-08-07 13:55:45 +02:00
Member

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)...
P1068: #68359 snippet



diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index c672bc9f3e2..ae789aaa47c 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1002,6 +1002,14 @@ 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 if smoke type changed from flow to domain, not sure why... */
+  bool oldhas_voxel_attributes = false;
+  foreach (Attribute &attr, mesh->attributes.attributes) {
+    if (attr.element == ATTR_ELEMENT_VOXEL) {
+      oldhas_voxel_attributes = true;
+    }
+  }
+
   mesh->clear();
   mesh->used_shaders = used_shaders;
   mesh->name = ustring(b_ob_data.name().c_str());
@@ -1048,9 +1056,17 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
   sync_mesh_fluid_motion(b_ob, scene, mesh);
 
   /* tag update */
+  bool has_voxel_attributes = false;
+  foreach (Attribute &attr, mesh->attributes.attributes) {
+    if (attr.element == ATTR_ELEMENT_VOXEL) {
+      has_voxel_attributes = true;
+    }
+  }
+
   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 != has_voxel_attributes);
 
   mesh->tag_update(scene, rebuild);
 
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)... [P1068: #68359 snippet](https://archive.blender.org/developer/P1068.txt) ``` diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index c672bc9f3e2..ae789aaa47c 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -1002,6 +1002,14 @@ 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 if smoke type changed from flow to domain, not sure why... */ + bool oldhas_voxel_attributes = false; + foreach (Attribute &attr, mesh->attributes.attributes) { + if (attr.element == ATTR_ELEMENT_VOXEL) { + oldhas_voxel_attributes = true; + } + } + mesh->clear(); mesh->used_shaders = used_shaders; mesh->name = ustring(b_ob_data.name().c_str()); @@ -1048,9 +1056,17 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph, sync_mesh_fluid_motion(b_ob, scene, mesh); /* tag update */ + bool has_voxel_attributes = false; + foreach (Attribute &attr, mesh->attributes.attributes) { + if (attr.element == ATTR_ELEMENT_VOXEL) { + has_voxel_attributes = true; + } + } + 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 != has_voxel_attributes); mesh->tag_update(scene, rebuild); ```
Member

#58569 is the same thing really...

#58569 is the same thing really...
Member

Since theseare so closely related, will merge this into #58569...

Since theseare so closely related, will merge this into #58569...
Member

Closed as duplicate of #58569

Closed as duplicate of #58569

This issue was referenced by blender/cycles@58023b198e

This issue was referenced by blender/cycles@58023b198e7df0a63612ad1d2707405f38f16ed1

This issue was referenced by b4051db4fc

This issue was referenced by b4051db4fc3ae509aa65f96af348f8241ceb726f
Member

Changed status from 'Duplicate' to: 'Resolved'

Changed status from 'Duplicate' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#68359
No description provided.