Fix #123579: VSE, no magenta preview for missing scene strips

Code that implemented "show missing media in magenta" in VSE preview
only implemented that for images and movies, and forgot that scene
strips can also be missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/124124
This commit is contained in:
Aras Pranckevicius 2024-07-04 10:27:52 +02:00 committed by Aras Pranckevicius
parent b31d34033a
commit 2aee84a611

@ -1035,7 +1035,7 @@ static bool seq_image_strip_is_multiview_render(Scene *scene,
return (seq->flag & SEQ_USE_VIEWS) != 0 && (scene->r.scemode & R_MULTIVIEW) != 0;
}
static ImBuf *create_missing_media_image(const SeqRenderData *context, const StripElem *orig)
static ImBuf *create_missing_media_image(const SeqRenderData *context, int width, int height)
{
if (context->ignore_missing_media) {
return nullptr;
@ -1046,8 +1046,7 @@ static ImBuf *create_missing_media_image(const SeqRenderData *context, const Str
return nullptr;
}
ImBuf *ibuf = IMB_allocImBuf(
max_ii(orig->orig_width, 1), max_ii(orig->orig_height, 1), 32, IB_rect);
ImBuf *ibuf = IMB_allocImBuf(max_ii(width, 1), max_ii(height, 1), 32, IB_rect);
float col[4] = {0.85f, 0.0f, 0.75f, 1.0f};
IMB_rectfill(ibuf, col);
return ibuf;
@ -1129,7 +1128,7 @@ static ImBuf *seq_render_image_strip(const SeqRenderData *context,
blender::seq::media_presence_set_missing(context->scene, seq, ibuf == nullptr);
if (ibuf == nullptr) {
return create_missing_media_image(context, s_elem);
return create_missing_media_image(context, s_elem->orig_width, s_elem->orig_height);
}
s_elem->orig_width = ibuf->x;
@ -1293,7 +1292,8 @@ static ImBuf *seq_render_movie_strip(const SeqRenderData *context,
blender::seq::media_presence_set_missing(context->scene, seq, ibuf == nullptr);
if (ibuf == nullptr) {
return create_missing_media_image(context, seq->strip->stripdata);
return create_missing_media_image(
context, seq->strip->stripdata->orig_width, seq->strip->stripdata->orig_height);
}
if (*r_is_proxy_image == false) {
@ -1533,7 +1533,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context,
/* don't refer to seq->scene above this point!, it can be nullptr */
if (seq->scene == nullptr) {
return nullptr;
return create_missing_media_image(context, context->rectx, context->recty);
}
/* Prevent rendering scene recursively. */