[Bf-blender-cvs] [eefd806afc1] blender-v2.81-release: Fix in addition to T61432: Sampling Subframes not working 2.8

Sebastián Barschkis noreply at git.blender.org
Thu Nov 7 21:34:59 CET 2019


Commit: eefd806afc15fe4ca7cbe5c039a4175ab4d9883c
Author: Sebastián Barschkis
Date:   Thu Nov 7 21:33:56 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rBeefd806afc15fe4ca7cbe5c039a4175ab4d9883c

Fix in addition to T61432: Sampling Subframes not working 2.8

As mentioned in the discussion, emission from particles did not make use of subframes. This commit resolves this issue.

===================================================================

M	source/blender/blenkernel/intern/smoke.c

===================================================================

diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 3db51c95fcb..de81e150074 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1478,7 +1478,8 @@ static void emit_from_particles(Object *flow_ob,
         }
       }
 
-      state.time = DEG_get_ctime(depsgraph); /* use depsgraph time */
+      /* DEG_get_ctime(depsgraph) does not give subframe time */
+      state.time = BKE_scene_frame_get(scene);
       if (psys_get_particle_state(&sim, p, &state, 0) == 0) {
         continue;
       }
@@ -2552,6 +2553,17 @@ static void update_flowsfluids(
             scene->r.subframe = 0.0f;
           }
 
+          /* update flow object frame */
+          BLI_mutex_lock(&object_update_lock);
+          BKE_object_modifier_update_subframe(depsgraph,
+                                              scene,
+                                              collob,
+                                              true,
+                                              5,
+                                              BKE_scene_frame_get(scene),
+                                              eModifierType_Smoke);
+          BLI_mutex_unlock(&object_update_lock);
+
           if (sfs->source == MOD_SMOKE_FLOW_SOURCE_PARTICLES) {
             /* emit_from_particles() updates timestep internally */
             emit_from_particles(collob, sds, sfs, &em_temp, depsgraph, scene, sdt);
@@ -2560,17 +2572,6 @@ static void update_flowsfluids(
             }
           }
           else { /* MOD_SMOKE_FLOW_SOURCE_MESH */
-            /* update flow object frame */
-            BLI_mutex_lock(&object_update_lock);
-            BKE_object_modifier_update_subframe(depsgraph,
-                                                scene,
-                                                collob,
-                                                true,
-                                                5,
-                                                BKE_scene_frame_get(scene),
-                                                eModifierType_Smoke);
-            BLI_mutex_unlock(&object_update_lock);
-
             /* apply flow */
             emit_from_mesh(collob, sds, sfs, &em_temp, sdt);
           }



More information about the Bf-blender-cvs mailing list