Page MenuHome

Smoke simulation - Sampling Substeps not working with modifiers
Confirmed, NormalPublicKNOWN ISSUE


System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.75

Blender Version
Broken: version: 2.83 (sub 13), branch: master, commit date: 2020-04-13 17:13, hash: rBad317a5ffdcf
Worked: (newest version of Blender that worked as expected)

Short description of error
In a smoke simulation, the substeps do not work as soon as the emitter object is moved by a modifier.

Exact steps for others to reproduce the error

  • With the default cube, hit f3 search "quick smoke" to quickly set up a smoke simulation.
  • Animate the cube's translation using different methods, including armature-based animation (which uses a modifier).Make the translation fast enough so there's a clear gap between two frames.
  • Se what happens with and without the sampling substeps on the emitter's options

Alternatively, use this simple demo file in which each situation I can think of is represented. You just need to bake the simulation.

Event Timeline

Sebastián Barschkis (sebbas) changed the task status from Needs Triage to Confirmed.Apr 15 2020, 7:03 PM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".Apr 16 2020, 10:35 AM

The core issue here is that BKE_object_modifier_update_subframe is not working correctly, because it's not integrated with the depsgraph.

This code can fix the issue in this specific file, but it is just a hack on top of another hack...

diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a12307b7c18..53b5adcbb4b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -4576,7 +4576,22 @@ bool BKE_object_modifier_update_subframe(Depsgraph *depsgraph,
   /* was originally ID_RECALC_ALL - TODO - which flags are really needed??? */
   /* TODO(sergey): What about animation? */
   ob->id.recalc |= ID_RECALC_ALL;
+  if (ob->data != NULL) {
+    ((ID *)ob->data)->recalc |= ID_RECALC_ALL;
+  }
   if (update_mesh) {
+    if (parent_recursion > 0) {
+      LISTBASE_FOREACH (ModifierData *, modifier, &ob->modifiers) {
+        if (modifier->type == eModifierType_Hook) {
+          HookModifierData *hmd = (HookModifierData *)modifier;
+          if (hmd->object != NULL) {
+            BKE_object_modifier_update_subframe(
+                depsgraph, scene, hmd->object, 0, parent_recursion - 1, frame, type);
+          }
+        }
+      }
+    }
     BKE_animsys_evaluate_animdata(&ob->id, ob->adt, frame, ADT_RECALC_ANIM, flush_to_original);
     /* ignore cache clear during subframe updates
      * to not mess up cache validity */

@Sergey Sharybin (sergey) How difficult is it to get this working properly? Evaluating the same depsgraph at different times at the same time seems quite difficult to me... Should this be a known issue for now?

@Jacques Lucke (JacquesLucke), AFAIR this BKE_object_modifier_update_subframe is used from object's evaluation, which makes it absolutely unreliable due to threading conflicts. We should not add even more design-violating code into here. But real solution is indeed beyond the bug tracker work :(

Jacques Lucke (JacquesLucke) changed the subtype of this task from "Bug" to "Known Issue".Apr 23 2020, 2:47 PM