Skip to content

Commit 4761bca

Browse files
eloisebrosseaucedrik-fuoco-adsk
authored andcommitted
Fix live review annotation opacity (AcademySoftwareFoundation#613)
### 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 <eloise.brosseau@autodesk.com> Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
1 parent 3c46a90 commit 4761bca

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/plugins/rv-packages/otio_reader/annotation_hook.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def hook_function(in_timeline, argument_map=None) -> None:
4646
"join": 3,
4747
"cap": 2,
4848
"splat": 1,
49-
"mode": 0 if layer.type.lower() == "color" else 1,
49+
"mode": 0 if layer.type == "COLOR" else 1,
5050
},
5151
)
5252

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

6969
global_width = 2 / 15 # 0.133333...
70+
7071
for point in layer.points:
71-
commands.insertFloatProperty(
72-
points_property,
73-
[point.x * global_scale.x, point.y * global_scale.y],
74-
)
75-
commands.insertFloatProperty(
76-
width_property, [point.width * global_width]
77-
)
72+
points = commands.getFloatProperty(points_property)
73+
if (
74+
len(points) > 1
75+
and points[-1] == point.y * global_scale.y
76+
and points[-2] == point.x * global_scale.x
77+
):
78+
pass
79+
else:
80+
commands.insertFloatProperty(
81+
points_property,
82+
[point.x * global_scale.x, point.y * global_scale.y],
83+
)
84+
commands.insertFloatProperty(
85+
width_property, [point.width * global_width]
86+
)

0 commit comments

Comments
 (0)