Page MenuHome

Fix T81893: Blender crashes when using Gas Fluid Domain in Cycles
AbandonedPublic

Authored by Manuel Castilla (manzanilla) on Oct 25 2020, 1:46 AM.

Details

Summary

This patch seems to resolve the issue but might cause other issues. I know very little of this area but at least I think this might help in spotting the issue, so please anyone review it carefully, feel free to just decline it and do other patch.

Problem:
I think the issue happens when the volume is updated (sync) 2 consecutive times. volume_sync was clearing all the mesh data at the start of the method and if by any chance at the end of "volume_sync" rebuild is false (which happens the second time is called because voxels attributes are the same as I guess they were already updated on the first call). All mesh data end up cleared as volume mesh is not tagged for rebuild. This causes a crash when the volume mesh arrives to cycles BVH compute algorithm as it needs mesh triangles for its calculation.

Solution:
Instead of clearing the whole mesh on "volume_sync", I just clear the mesh attributes as in this method I think only the attributes are modified. If voxels attributes end up being the same, I think it makes sense to keep the mesh data as it should be the same. Otherwise rebuild will be true, and then the volume geometry will be regenerated I guess, no need to delete it.

Similar issue was fixed here: https://developer.blender.org/T73626

Diff Detail

Repository
rB Blender
Branch
T81893 (branched from master)
Build Status
Buildable 10902
Build 10902: arc lint + arc unit