Fix T90855: Transform effect gives inconsistent output
When using downscaled preview size with proxies, transform effect doesn't compensate for fact, that pixels are effectively larger. There was compensation for scene render size already. Use same compensation method as text effect uses for font size.
This commit is contained in:
parent
4266538ab9
commit
84f7bf56a8
Notes:
blender-bot
2023-02-14 11:28:43 +01:00
Referenced by issue #90855, VSE: Preview uses proxy (not project) dims for pixel-based X/Y position translations in "Effect strip" section of Transform strip (but always renders correctly)
|
@ -2451,7 +2451,6 @@ static void do_transform_effect(const SeqRenderData *context,
|
|||
int total_lines,
|
||||
ImBuf *out)
|
||||
{
|
||||
Scene *scene = context->scene;
|
||||
TransformVars *transform = (TransformVars *)seq->effectdata;
|
||||
float scale_x, scale_y, translate_x, translate_y, rotate_radians;
|
||||
|
||||
|
@ -2469,10 +2468,14 @@ static void do_transform_effect(const SeqRenderData *context,
|
|||
|
||||
/* Translate */
|
||||
if (!transform->percent) {
|
||||
float rd_s = (scene->r.size / 100.0f);
|
||||
/* Compensate text size for preview render size. */
|
||||
double proxy_size_comp = context->scene->r.size / 100.0;
|
||||
if (context->preview_render_size != SEQ_RENDER_SIZE_SCENE) {
|
||||
proxy_size_comp = SEQ_rendersize_to_scale_factor(context->preview_render_size);
|
||||
}
|
||||
|
||||
translate_x = transform->xIni * rd_s + (x / 2.0f);
|
||||
translate_y = transform->yIni * rd_s + (y / 2.0f);
|
||||
translate_x = transform->xIni * proxy_size_comp + (x / 2.0f);
|
||||
translate_y = transform->yIni * proxy_size_comp + (y / 2.0f);
|
||||
}
|
||||
else {
|
||||
translate_x = x * (transform->xIni / 100.0f) + (x / 2.0f);
|
||||
|
|
Loading…
Reference in New Issue