diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-14 21:16:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 14:40:04 +0300 |
commit | 9ea1b88f0f01a617f452d5eaa44ecbebbaa95c4e (patch) | |
tree | 87dd1c363d2e8ea17178559b6df61bf9d54fbe13 /source/blender/sequencer/intern | |
parent | b8ffd43bd28ff93c5420d8a50c2cde5a061be118 (diff) |
Cleanup: add utlity function to compute render resolution
Instead of duplicating logic many times.
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r-- | source/blender/sequencer/intern/proxy.c | 12 | ||||
-rw-r--r-- | source/blender/sequencer/intern/render.c | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index 522c64f7791..374e18dd36a 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -511,15 +511,11 @@ void SEQ_proxy_rebuild(SeqIndexBuildContext *context, } /* fail safe code */ + int width, height; + BKE_render_resolution(&scene->r, false, &width, &height); - SEQ_render_new_render_data(bmain, - context->depsgraph, - context->scene, - roundf((scene->r.size * (float)scene->r.xsch) / 100.0f), - roundf((scene->r.size * (float)scene->r.ysch) / 100.0f), - 100, - false, - &render_context); + SEQ_render_new_render_data( + bmain, context->depsgraph, context->scene, width, height, 100, false, &render_context); render_context.skip_cache = true; render_context.is_proxy_render = true; diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index 15487a597d1..b7dc0e7035d 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -1447,8 +1447,8 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, if ((sequencer_view3d_fn && do_seq_gl && camera) && is_thread_main) { char err_out[256] = "unknown"; - const int width = (scene->r.xsch * scene->r.size) / 100; - const int height = (scene->r.ysch * scene->r.size) / 100; + int width, height; + BKE_render_resolution(&scene->r, false, &width, &height); const char *viewname = BKE_scene_multiview_render_view_name_get(&scene->r, context->view_id); unsigned int draw_flags = V3D_OFSDRAW_NONE; |