Skip to content

Commit

Permalink
Add default global scale if missing
Browse files Browse the repository at this point in the history
Signed-off-by: Éloïse Brosseau <[email protected]>
  • Loading branch information
eloisebrosseau committed Dec 2, 2024
1 parent ee1ecd5 commit 21daaa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/rv-packages/otio_reader/annotation_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 21daaa1

Please sign in to comment.