Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2019-11-07 23:33:56 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2019-11-07 23:33:56 +0300
commiteefd806afc15fe4ca7cbe5c039a4175ab4d9883c (patch)
tree68fad3a0a36066b59ac6eb3b32fa8cd323be83e4
parent74af6987699a5064cb95d15b6bd318d1ea2f5976 (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/smoke.c25
1 files changed, 13 insertions, 12 deletions
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);
}