parameters: (curve_list, animated, i)
docstring: Generates the dictionary corresponding to properties/offsetKeyFrame.json
  
      Args:
          curve_list (list)                : Stores bezier curve in Lottie format
          animated   (lxml.etree._Element) : Synfig format animation
          i          (int)                 : Iterator for animation
  
      Returns:
          (TypeError) : If a constant interval is encountered
          (None)      : In all other cases
docstring_summary: Generates the dictionary corresponding to properties/offsetKeyFrame.json
docstring_tokens: Generates the dictionary corresponding to properties / offsetKeyFrame . json
function: def gen_properties_offset_keyframe(curve_list, animated, i):
      """
      Generates the dictionary corresponding to properties/offsetKeyFrame.json
  
      Args:
          curve_list (list)                : Stores bezier curve in Lottie format
          animated   (lxml.etree._Element) : Synfig format animation
          i          (int)                 : Iterator for animation
  
      Returns:
          (TypeError) : If a constant interval is encountered
          (None)      : In all other cases
      """
      lottie = curve_list[-1]
  
      waypoint, next_waypoint = animated[i], animated[i+1]
      cur_get_after, next_get_before = waypoint.attrib["after"], next_waypoint.attrib["before"]
      cur_get_before, next_get_after = waypoint.attrib["before"], next_waypoint.attrib["after"]
  
      # "angle" interpolations never call this function, can be removed by confirming
      if animated.attrib["type"] == "angle":
          if cur_get_after == "auto":
              cur_get_after = "linear"
          if cur_get_before == "auto":
              cur_get_before = "linear"
          if next_get_before == "auto":
              next_get_before = "linear"
          if next_get_after == "auto":
              next_get_after = "linear"
  
      # Synfig only supports constant interpolations for points
      # "points" never call this function, can be removed by confirming
      if animated.attrib["type"] == "points":
          cur_get_after = "constant"
          cur_get_before = "constant"
          next_get_after = "constant"
          next_get_before = "constant"
  
      # Calculate positions of waypoints
      cur_pos = parse_position(animated, i)
      next_pos = parse_position(animated, i + 1)
  
      lottie["i"] = {}    # Time bezier curve, not used in synfig
      lottie["o"] = {}    # Time bezier curve, not used in synfig
      lottie["i"]["x"] = 0.5
      lottie["i"]["y"] = 0.5
      lottie["o"]["x"] = 0.5
      lottie["o"]["y"] = 0.5
      if cur_get_after == "halt": # For ease out
          ease_out(lottie)
      if next_get_before == "halt": # For ease in
          ease_in(lottie)
      lottie["t"] = get_frame(waypoint)
  
      lottie["s"] = change_axis(cur_pos[0], cur_pos[1])
      lottie["e"] = change_axis(next_pos[0], next_pos[1])
      lottie["to"] = []
      lottie["ti"] = []
  
      # Calculating the unchanged tangent
      try:
          out_val, in_val = calc_tangent(animated, lottie, i)
      except Exception as excep:
          # This means constant interval
          return excep
  
      # This module is only needed for origin animation
      lottie["to"] = out_val.get_list()
      lottie["ti"] = in_val.get_list()
  
      # TCB/!TCB and list is not empty
      if cur_get_before == "auto" and cur_get_after != "auto" and i > 0:
          curve_list[-2]["ti"] = copy.deepcopy(lottie["to"])
          curve_list[-2]["ti"] = [-item/settings.TANGENT_FACTOR for item in curve_list[-2]["ti"]]
          curve_list[-2]["ti"][1] = -curve_list[-2]["ti"][1]
          if cur_get_after == "halt":
              curve_list[-2]["i"]["x"] = settings.IN_TANGENT_X
              curve_list[-2]["i"]["y"] = settings.IN_TANGENT_Y
  
      # Lottie tangent length is larger than synfig
      lottie["ti"] = [item/settings.TANGENT_FACTOR for item in lottie["ti"]]
      lottie["to"] = [item/settings.TANGENT_FACTOR for item in lottie["to"]]
  
      # Lottie and synfig use different tangents SEE DOCUMENTATION
      lottie["ti"] = [-item for item in lottie["ti"]]
  
      # IMPORTANT to and ti have to be relative
      # The y-axis is different in lottie
      lottie["ti"][1] = -lottie["ti"][1]
      lottie["to"][1] = -lottie["to"][1]
  
      # These tangents will be used in actual calculation of points according to
      # Synfig
      lottie["synfig_to"] = [tangent for tangent in lottie["to"]]
      lottie["synfig_ti"] = [-tangent for tangent in lottie["ti"]]
      if cur_get_after == "halt":
          lottie["synfig_to"] = [0 for val in lottie["synfig_to"]]
      if next_get_before == "halt":
          lottie["synfig_ti"] = [0 for val in lottie["synfig_ti"]]
function_tokens: def gen_properties_offset_keyframe ( curve_list , animated , i ) : lottie = curve_list [ - 1 ] waypoint , next_waypoint = animated [ i ] , animated [ i + 1 ] cur_get_after , next_get_before = waypoint . attrib [ "after" ] , next_waypoint . attrib [ "before" ] cur_get_before , next_get_after = waypoint . attrib [ "before" ] , next_waypoint . attrib [ "after" ] # "angle" interpolations never call this function, can be removed by confirming if animated . attrib [ "type" ] == "angle" : if cur_get_after == "auto" : cur_get_after = "linear" if cur_get_before == "auto" : cur_get_before = "linear" if next_get_before == "auto" : next_get_before = "linear" if next_get_after == "auto" : next_get_after = "linear" # Synfig only supports constant interpolations for points # "points" never call this function, can be removed by confirming if animated . attrib [ "type" ] == "points" : cur_get_after = "constant" cur_get_before = "constant" next_get_after = "constant" next_get_before = "constant" # Calculate positions of waypoints cur_pos = parse_position ( animated , i ) next_pos = parse_position ( animated , i + 1 ) lottie [ "i" ] = { } # Time bezier curve, not used in synfig lottie [ "o" ] = { } # Time bezier curve, not used in synfig lottie [ "i" ] [ "x" ] = 0.5 lottie [ "i" ] [ "y" ] = 0.5 lottie [ "o" ] [ "x" ] = 0.5 lottie [ "o" ] [ "y" ] = 0.5 if cur_get_after == "halt" : # For ease out ease_out ( lottie ) if next_get_before == "halt" : # For ease in ease_in ( lottie ) lottie [ "t" ] = get_frame ( waypoint ) lottie [ "s" ] = change_axis ( cur_pos [ 0 ] , cur_pos [ 1 ] ) lottie [ "e" ] = change_axis ( next_pos [ 0 ] , next_pos [ 1 ] ) lottie [ "to" ] = [ ] lottie [ "ti" ] = [ ] # Calculating the unchanged tangent try : out_val , in_val = calc_tangent ( animated , lottie , i ) except Exception as excep : # This means constant interval return excep # This module is only needed for origin animation lottie [ "to" ] = out_val . get_list ( ) lottie [ "ti" ] = in_val . get_list ( ) # TCB/!TCB and list is not empty if cur_get_before == "auto" and cur_get_after != "auto" and i > 0 : curve_list [ - 2 ] [ "ti" ] = copy . deepcopy ( lottie [ "to" ] ) curve_list [ - 2 ] [ "ti" ] = [ - item / settings . TANGENT_FACTOR for item in curve_list [ - 2 ] [ "ti" ] ] curve_list [ - 2 ] [ "ti" ] [ 1 ] = - curve_list [ - 2 ] [ "ti" ] [ 1 ] if cur_get_after == "halt" : curve_list [ - 2 ] [ "i" ] [ "x" ] = settings . IN_TANGENT_X curve_list [ - 2 ] [ "i" ] [ "y" ] = settings . IN_TANGENT_Y # Lottie tangent length is larger than synfig lottie [ "ti" ] = [ item / settings . TANGENT_FACTOR for item in lottie [ "ti" ] ] lottie [ "to" ] = [ item / settings . TANGENT_FACTOR for item in lottie [ "to" ] ] # Lottie and synfig use different tangents SEE DOCUMENTATION lottie [ "ti" ] = [ - item for item in lottie [ "ti" ] ] # IMPORTANT to and ti have to be relative # The y-axis is different in lottie lottie [ "ti" ] [ 1 ] = - lottie [ "ti" ] [ 1 ] lottie [ "to" ] [ 1 ] = - lottie [ "to" ] [ 1 ] # These tangents will be used in actual calculation of points according to # Synfig lottie [ "synfig_to" ] = [ tangent for tangent in lottie [ "to" ] ] lottie [ "synfig_ti" ] = [ - tangent for tangent in lottie [ "ti" ] ] if cur_get_after == "halt" : lottie [ "synfig_to" ] = [ 0 for val in lottie [ "synfig_to" ] ] if next_get_before == "halt" : lottie [ "synfig_ti" ] = [ 0 for val in lottie [ "synfig_ti" ] ]