Skip to content

Commit

Permalink
Address feedback from PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-ynput committed Jan 22, 2025
1 parent cc0dc4c commit f2afc7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions client/ayon_flame/otio/flame_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import json
import logging
import opentimelineio as otio

from . import utils
from . import tw_bake

import flame
from pprint import pformat
Expand Down Expand Up @@ -112,7 +114,6 @@ def create_time_effects(otio_clip, clip_data, speed, time_effect=None):
else:
# Interpolate curves.
# And retrieve interpolated value per frames.
from . import tw_bake
tw_obj = tw_bake.Timewarp()
iframes = tw_obj.bake_flame_tw_setup(
time_effect.setup_data
Expand Down Expand Up @@ -142,18 +143,19 @@ def create_time_effects(otio_clip, clip_data, speed, time_effect=None):

# Potential constant retimes.
if otio_effect is None:
if speed not in (1, 0):
otio_effect = otio.schema.LinearTimeWarp(
name="Speed",
time_scalar=speed
)

# freeze frame effect
elif speed == 0.:
if speed == 0.:
otio_effect = otio.schema.FreezeFrame(
name="FreezeFrame"
)

elif speed != 1:
otio_effect = otio.schema.LinearTimeWarp(
name="Speed",
time_scalar=speed
)

if otio_effect:
# add otio effect to clip effects
otio_clip.effects.append(otio_effect)
Expand Down
4 changes: 2 additions & 2 deletions client/ayon_flame/otio/tw_bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ def __init__(self, from_frame, to_frame, value1, value2, tangent1, tangent2):

@staticmethod
def dot_product_vector_matrix(matrix, vector):
return [sum(a*b for a,b in zip(row, vector)) for row in matrix]
return [sum(a*b for a,b in zip(row, vector)) for row in matrix]

@staticmethod
def dot_product_vector_vector(vector1, vector2):
return sum(x*y for x, y in zip(vector1, vector2))
return sum(x*y for x, y in zip(vector1, vector2))

def value_at(self, frame):
if frame == self.start_frame:
Expand Down

0 comments on commit f2afc7d

Please sign in to comment.