diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-08-10 10:09:49 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-08-10 10:09:49 +0300 |
commit | e2d5e8d58411faca19043e51e55ff2e11b26acde (patch) | |
tree | 8140e9758dc5f31b4591136ec8f91ad08a8dc22d | |
parent | 4fd73e74655321c600f3bce1a9eed24f7a87ce1a (diff) | |
parent | 6640ed92c09c83bfe01cab539f212957b5ca2e16 (diff) |
Merge branch 'blender-v2.90-release'
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 42 | ||||
-rw-r--r-- | source/blender/draw/intern/shaders/common_view_lib.glsl | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.cc | 1 |
3 files changed, 38 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index dbcb83b8402..a2a45ae56b3 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3151,12 +3151,33 @@ static ImBuf *seq_render_image_strip(const SeqRenderData *context, return ibuf; } +static ImBuf *seq_render_movie_strip_custom_file_proxy(const SeqRenderData *context, + Sequence *seq, + int cfra) +{ + char name[PROXY_MAXFILE]; + StripProxy *proxy = seq->strip->proxy; + + if (proxy->anim == NULL) { + if (seq_proxy_get_custom_file_fname(seq, name, context->view_id)) { + proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name); + } + if (proxy->anim == NULL) { + return NULL; + } + } + + int frameno = (int)BKE_sequencer_give_stripelem_index(seq, cfra) + seq->anim_startofs; + 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. */ static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, Sequence *seq, float nr, + float cfra, StripAnim *sanim, bool *r_is_proxy_image) { @@ -3166,10 +3187,19 @@ static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, IMB_anim_set_preseek(sanim->anim, seq->anim_preseek); if (seq_can_use_proxy(seq, psize)) { - ibuf = IMB_anim_absolute(sanim->anim, - nr + seq->anim_startofs, - seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, - psize); + /* Try to get a proxy image. + * Movie proxies are handled by ImBuf module with exception of `custom file` setting. */ + if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE && + seq->strip->proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) { + ibuf = seq_render_movie_strip_custom_file_proxy(context, seq, cfra); + } + else { + ibuf = IMB_anim_absolute(sanim->anim, + nr + seq->anim_startofs, + seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, + psize); + } + if (ibuf != NULL) { *r_is_proxy_image = true; } @@ -3218,7 +3248,7 @@ static ImBuf *seq_render_movie_strip( for (ibuf_view_id = 0, sanim = seq->anims.first; sanim; sanim = sanim->next, ibuf_view_id++) { if (sanim->anim) { ibuf_arr[ibuf_view_id] = seq_render_movie_strip_view( - context, seq, nr, sanim, r_is_proxy_image); + context, seq, nr, cfra, sanim, r_is_proxy_image); } } @@ -3255,7 +3285,7 @@ static ImBuf *seq_render_movie_strip( MEM_freeN(ibuf_arr); } else { - ibuf = seq_render_movie_strip_view(context, seq, nr, sanim, r_is_proxy_image); + ibuf = seq_render_movie_strip_view(context, seq, nr, cfra, sanim, r_is_proxy_image); } if (ibuf == NULL) { diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index a55d2cd8c1a..73c112fe3fb 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -85,7 +85,7 @@ vec4 pack_line_data(vec2 frag_co, vec2 edge_start, vec2 edge_pos) uniform int resourceChunk; #ifdef GPU_VERTEX_SHADER -# ifdef GL_ARB_shader_draw_parameters +# ifdef GPU_ARB_shader_draw_parameters # define baseInstance gl_BaseInstanceARB # else /* no ARB_shader_draw_parameters */ uniform int baseInstance; diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index 76c439b86b5..03b7d5402f5 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -120,6 +120,7 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH]) } if (GLEW_ARB_shader_draw_parameters) { strcat(defines, "#extension GL_ARB_shader_draw_parameters : enable\n"); + strcat(defines, "#define GPU_ARB_shader_draw_parameters\n"); } if (GPU_arb_texture_cube_map_array_is_supported()) { strcat(defines, "#extension GL_ARB_texture_cube_map_array : enable\n"); |