Skip to content

Commit

Permalink
Fix live review annotation opacity (AcademySoftwareFoundation#613)
Browse files Browse the repository at this point in the history
### Fix live review annotation opacity

### Summarize your change.

Add a new points to the list of points to draw only if it's not already
there.

### Describe the reason for the change.

The number of points was causing the opacity level too be too opaque.

### Describe what you have tested and on which operating system.

The opacity level was tested by changing it's value in the ReviewApp and
seeing the resulting annotation in RV on MacOS.

Signed-off-by: Éloïse Brosseau <[email protected]>
  • Loading branch information
eloisebrosseau authored Nov 11, 2024
1 parent 0372990 commit 8093a39
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/plugins/rv-packages/otio_reader/annotation_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def hook_function(in_timeline, argument_map=None) -> None:
"join": 3,
"cap": 2,
"splat": 1,
"mode": 0 if layer.type.lower() == "color" else 1,
"mode": 0 if layer.type == "COLOR" else 1,
},
)

Expand All @@ -67,11 +67,20 @@ def hook_function(in_timeline, argument_map=None) -> None:
commands.newProperty(width_property, commands.FloatType, 1)

global_width = 2 / 15 # 0.133333...

for point in layer.points:
commands.insertFloatProperty(
points_property,
[point.x * global_scale.x, point.y * global_scale.y],
)
commands.insertFloatProperty(
width_property, [point.width * global_width]
)
points = commands.getFloatProperty(points_property)
if (
len(points) > 1
and points[-1] == point.y * global_scale.y
and points[-2] == point.x * global_scale.x
):
pass
else:
commands.insertFloatProperty(
points_property,
[point.x * global_scale.x, point.y * global_scale.y],
)
commands.insertFloatProperty(
width_property, [point.width * global_width]
)

0 comments on commit 8093a39

Please sign in to comment.