[Bf-blender-cvs] [6c9178b183f] master: Fix T61432: Sampling Subframes not working 2.8

Sebastián Barschkis noreply at git.blender.org
Wed Oct 9 15:04:17 CEST 2019


Commit: 6c9178b183f5267e07a6c55497b6d496e468a709
Author: Sebastián Barschkis
Date:   Wed Oct 9 15:00:25 2019 +0200
Branches: master
https://developer.blender.org/rB6c9178b183f5267e07a6c55497b6d496e468a709

Fix T61432: Sampling Subframes not working 2.8

Uncommented subframe logic and added correct time getter function (with subframe part in frame) to subframe update function

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

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

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

diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index e6c414b92da..1bd2fbffd58 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2527,17 +2527,13 @@ static void update_flowsfluids(
       }
       /* sample subframes */
       else {
-#  if 0
         int scene_frame = (int)DEG_get_ctime(depsgraph);
-#  endif
         // float scene_subframe = scene->r.subframe;  // UNUSED
         int subframe;
         for (subframe = 0; subframe <= subframes; subframe++) {
           EmissionMap em_temp = {NULL};
           float sample_size = 1.0f / (float)(subframes + 1);
-#  if 0
           float prev_frame_pos = sample_size * (float)(subframe + 1);
-#  endif
           float sdt = dt * sample_size;
           int hires_multiplier = 1;
 
@@ -2545,8 +2541,6 @@ static void update_flowsfluids(
             hires_multiplier = sds->amplify + 1;
           }
 
-          /* TODO: setting the scene frame no longer works with the new depsgraph. */
-#  if 0
           /* set scene frame to match previous frame + subframe
            * or use current frame for last sample */
           if (subframe < subframes) {
@@ -2557,7 +2551,6 @@ static void update_flowsfluids(
             scene->r.cfra = scene_frame;
             scene->r.subframe = 0.0f;
           }
-#  endif
 
           if (sfs->source == MOD_SMOKE_FLOW_SOURCE_PARTICLES) {
             /* emit_from_particles() updates timestep internally */
@@ -2570,7 +2563,7 @@ static void update_flowsfluids(
             /* update flow object frame */
             BLI_mutex_lock(&object_update_lock);
             BKE_object_modifier_update_subframe(
-                depsgraph, scene, collob, true, 5, DEG_get_ctime(depsgraph), eModifierType_Smoke);
+                depsgraph, scene, collob, true, 5, BKE_scene_frame_get(scene), eModifierType_Smoke);
             BLI_mutex_unlock(&object_update_lock);
 
             /* apply flow */



More information about the Bf-blender-cvs mailing list