Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/render.c
| Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | void SEQ_render_new_render_data(Main *bmain, | ||||
| r_context->is_prefetch_render = false; | r_context->is_prefetch_render = false; | ||||
| } | } | ||||
| void seq_render_state_init(SeqRenderState *state) | void seq_render_state_init(SeqRenderState *state) | ||||
| { | { | ||||
| state->scene_parents = NULL; | state->scene_parents = NULL; | ||||
| } | } | ||||
| StripElem *SEQ_render_give_stripelem(Sequence *seq, int timeline_frame) | StripElem *SEQ_render_give_stripelem(const Scene *scene, Sequence *seq, int timeline_frame) | ||||
| { | { | ||||
| StripElem *se = seq->strip->stripdata; | StripElem *se = seq->strip->stripdata; | ||||
| if (seq->type == SEQ_TYPE_IMAGE) { | if (seq->type == SEQ_TYPE_IMAGE) { | ||||
| /* only IMAGE strips use the whole array, MOVIE strips use only the first element, | /* only IMAGE strips use the whole array, MOVIE strips use only the first element, | ||||
| * all other strips don't use this... | * all other strips don't use this... | ||||
| */ | */ | ||||
| int frame_index = (int)seq_give_frame_index(seq, timeline_frame); | int frame_index = (int)seq_give_frame_index(scene, seq, timeline_frame); | ||||
| if (frame_index == -1 || se == NULL) { | if (frame_index == -1 || se == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| se += frame_index + seq->anim_startofs; | se += frame_index + seq->anim_startofs; | ||||
| } | } | ||||
| return se; | return se; | ||||
| ▲ Show 20 Lines • Show All 607 Lines • ▼ Show 20 Lines | static ImBuf *seq_render_effect_strip_impl(const SeqRenderData *context, | ||||
| if (!sh.execute && !(sh.execute_slice && sh.init_execution)) { | if (!sh.execute && !(sh.execute_slice && sh.init_execution)) { | ||||
| /* effect not supported in this version... */ | /* effect not supported in this version... */ | ||||
| out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect); | out = IMB_allocImBuf(context->rectx, context->recty, 32, IB_rect); | ||||
| return out; | return out; | ||||
| } | } | ||||
| if (seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) { | if (seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) { | ||||
| sh.get_default_fac(seq, timeline_frame, &fac, &facf); | sh.get_default_fac(scene, seq, timeline_frame, &fac, &facf); | ||||
| facf = fac; | facf = fac; | ||||
| } | } | ||||
| else { | else { | ||||
| fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "effect_fader", 0, NULL); | fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "effect_fader", 0, NULL); | ||||
| if (fcu) { | if (fcu) { | ||||
| fac = facf = evaluate_fcurve(fcu, timeline_frame); | fac = facf = evaluate_fcurve(fcu, timeline_frame); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | static ImBuf *seq_render_image_strip(const SeqRenderData *context, | ||||
| float timeline_frame, | float timeline_frame, | ||||
| bool *r_is_proxy_image) | bool *r_is_proxy_image) | ||||
| { | { | ||||
| char name[FILE_MAX]; | char name[FILE_MAX]; | ||||
| const char *ext = NULL; | const char *ext = NULL; | ||||
| char prefix[FILE_MAX]; | char prefix[FILE_MAX]; | ||||
| ImBuf *ibuf = NULL; | ImBuf *ibuf = NULL; | ||||
| StripElem *s_elem = SEQ_render_give_stripelem(seq, timeline_frame); | StripElem *s_elem = SEQ_render_give_stripelem(context->scene, seq, timeline_frame); | ||||
| if (s_elem == NULL) { | if (s_elem == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| BLI_join_dirfile(name, sizeof(name), seq->strip->dir, s_elem->name); | BLI_join_dirfile(name, sizeof(name), seq->strip->dir, s_elem->name); | ||||
| BLI_path_abs(name, BKE_main_blendfile_path_from_global()); | BLI_path_abs(name, BKE_main_blendfile_path_from_global()); | ||||
| /* Try to get a proxy image. */ | /* Try to get a proxy image. */ | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (proxy->anim == NULL) { | ||||
| if (seq_proxy_get_custom_file_fname(seq, name, context->view_id)) { | if (seq_proxy_get_custom_file_fname(seq, name, context->view_id)) { | ||||
| proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name); | proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name); | ||||
| } | } | ||||
| if (proxy->anim == NULL) { | if (proxy->anim == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| } | } | ||||
| int frameno = (int)seq_give_frame_index(seq, timeline_frame) + seq->anim_startofs; | int frameno = (int)seq_give_frame_index(context->scene, seq, timeline_frame) + | ||||
| seq->anim_startofs; | |||||
| return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE); | return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE); | ||||
| } | } | ||||
| /** | /** | ||||
| * Render individual view for multi-view or single (default view) for mono-view. | * Render individual view for multi-view or single (default view) for mono-view. | ||||
| */ | */ | ||||
| static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, | static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, | ||||
| Sequence *seq, | Sequence *seq, | ||||
| ▲ Show 20 Lines • Show All 573 Lines • ▼ Show 20 Lines | |||||
| * \{ */ | * \{ */ | ||||
| static ImBuf *do_render_strip_uncached(const SeqRenderData *context, | static ImBuf *do_render_strip_uncached(const SeqRenderData *context, | ||||
| SeqRenderState *state, | SeqRenderState *state, | ||||
| Sequence *seq, | Sequence *seq, | ||||
| float timeline_frame, | float timeline_frame, | ||||
| bool *r_is_proxy_image) | bool *r_is_proxy_image) | ||||
| { | { | ||||
| ImBuf *ibuf = NULL; | ImBuf *ibuf = NULL; | ||||
| float frame_index = seq_give_frame_index(seq, timeline_frame); | float frame_index = seq_give_frame_index(context->scene, seq, timeline_frame); | ||||
| int type = (seq->type & SEQ_TYPE_EFFECT) ? SEQ_TYPE_EFFECT : seq->type; | int type = (seq->type & SEQ_TYPE_EFFECT) ? SEQ_TYPE_EFFECT : seq->type; | ||||
| switch (type) { | switch (type) { | ||||
| case SEQ_TYPE_META: { | case SEQ_TYPE_META: { | ||||
| ibuf = do_render_strip_seqbase(context, state, seq, frame_index); | ibuf = do_render_strip_seqbase(context, state, seq, frame_index); | ||||
| break; | break; | ||||
| } | } | ||||
| case SEQ_TYPE_SCENE: { | case SEQ_TYPE_SCENE: { | ||||
| ▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines | |||||