Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/seqprefetch.c
| Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | static bool seq_prefetch_is_cache_full(Scene *scene) | ||||
| return BKE_sequencer_cache_recycle_item(pfjob->scene) == false; | return BKE_sequencer_cache_recycle_item(pfjob->scene) == false; | ||||
| } | } | ||||
| static float seq_prefetch_cfra(PrefetchJob *pfjob) | static float seq_prefetch_cfra(PrefetchJob *pfjob) | ||||
| { | { | ||||
| return pfjob->cfra + pfjob->num_frames_prefetched; | return pfjob->cfra + pfjob->num_frames_prefetched; | ||||
| } | } | ||||
| static AnimationEvalContext seq_prefetch_anim_eval_context(PrefetchJob *pfjob) | |||||
| { | |||||
| return BKE_animsys_eval_context(pfjob->depsgraph, seq_prefetch_cfra(pfjob)); | |||||
| } | |||||
| void BKE_sequencer_prefetch_get_time_range(Scene *scene, int *start, int *end) | void BKE_sequencer_prefetch_get_time_range(Scene *scene, int *start, int *end) | ||||
| { | { | ||||
| PrefetchJob *pfjob = seq_prefetch_job_get(scene); | PrefetchJob *pfjob = seq_prefetch_job_get(scene); | ||||
| *start = pfjob->cfra; | *start = pfjob->cfra; | ||||
| *end = seq_prefetch_cfra(pfjob); | *end = seq_prefetch_cfra(pfjob); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| PrefetchJob *pfjob = (PrefetchJob *)job; | PrefetchJob *pfjob = (PrefetchJob *)job; | ||||
| while (seq_prefetch_cfra(pfjob) <= pfjob->scene->r.efra) { | while (seq_prefetch_cfra(pfjob) <= pfjob->scene->r.efra) { | ||||
| pfjob->scene_eval->ed->prefetch_job = NULL; | pfjob->scene_eval->ed->prefetch_job = NULL; | ||||
| seq_prefetch_update_depsgraph(pfjob); | seq_prefetch_update_depsgraph(pfjob); | ||||
| AnimData *adt = BKE_animdata_from_id(&pfjob->context_cpy.scene->id); | AnimData *adt = BKE_animdata_from_id(&pfjob->context_cpy.scene->id); | ||||
| AnimationEvalContext anim_eval_context = seq_prefetch_anim_eval_context(pfjob); | |||||
| BKE_animsys_evaluate_animdata( | BKE_animsys_evaluate_animdata( | ||||
| &pfjob->context_cpy.scene->id, adt, seq_prefetch_cfra(pfjob), ADT_RECALC_ALL, false); | &pfjob->context_cpy.scene->id, adt, &anim_eval_context, ADT_RECALC_ALL, false); | ||||
| /* This is quite hacky solution: | /* This is quite hacky solution: | ||||
| * We need cross-reference original scene with copy for cache. | * We need cross-reference original scene with copy for cache. | ||||
| * However depsgraph must not have this data, because it will try to kill this job. | * However depsgraph must not have this data, because it will try to kill this job. | ||||
| * Scene copy don't reference original scene. Perhaps, this could be done by depsgraph. | * Scene copy don't reference original scene. Perhaps, this could be done by depsgraph. | ||||
| * Set to NULL before return! | * Set to NULL before return! | ||||
| */ | */ | ||||
| pfjob->scene_eval->ed->prefetch_job = pfjob; | pfjob->scene_eval->ed->prefetch_job = pfjob; | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||