forked from bartvdbraak/blender
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.
This commit is contained in:
parent
74af698769
commit
eefd806afc
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user