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
This commit is contained in:
Sebastián Barschkis 2019-10-09 15:00:25 +02:00
parent 4aabea8b87
commit 6c9178b183
Notes: blender-bot 2023-02-14 03:45:49 +01:00
Referenced by issue #61432, Sampling Subframes not working 2.8
1 changed files with 1 additions and 8 deletions

View File

@ -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 */