From 21daaa1d7c025057e1dffd03c81ca4ff2f9ef57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFse=20Brosseau?= Date: Mon, 2 Dec 2024 16:43:19 -0500 Subject: [PATCH] Add default global scale if missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Éloïse Brosseau --- src/plugins/rv-packages/otio_reader/annotation_hook.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/rv-packages/otio_reader/annotation_hook.py b/src/plugins/rv-packages/otio_reader/annotation_hook.py index f7ed89c1e..7d583698a 100644 --- a/src/plugins/rv-packages/otio_reader/annotation_hook.py +++ b/src/plugins/rv-packages/otio_reader/annotation_hook.py @@ -58,6 +58,14 @@ def hook_function(in_timeline, argument_map=None) -> None: ) global_scale = argument_map.get("global_scale") + if global_scale is None: + first_source_node = commands.sourcesAtFrame(0)[0] + media_info = commands.sourceMediaInfo(first_source_node) + height = media_info["height"] + aspect_ratio = media_info["width"] / height + scale = aspect_ratio / 16 + global_scale = otio.schema.V2d(scale, scale) + points_property = f"{pen_component}.points" width_property = f"{pen_component}.width"