Skip to content

Commit

Permalink
Version 0.6.13
Browse files Browse the repository at this point in the history
AnimationClip: Early out when deciding ipo types
  • Loading branch information
mos9527 committed Feb 3, 2025
1 parent 875cb5f commit a12fd26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sssekai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__VERSION_MAJOR__ = 0
__VERSION_MINOR__ = 6
__VERSION_PATCH__ = 12
__VERSION_PATCH__ = 13

__version_tuple__ = (__VERSION_MAJOR__, __VERSION_MINOR__, __VERSION_PATCH__)
__version__ = "%s.%s.%s" % __version_tuple__
19 changes: 8 additions & 11 deletions sssekai/unity/AnimationClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,16 @@ def interpolate_stepped(t, p0, p1):
@staticmethod
def interpolation_segment(lhs: "KeyFrame", rhs: "KeyFrame") -> List[Interpolation]:
"""Interpolation of the segment between lhs and rhs"""
rhs = lhs.next
if not rhs:
return [Interpolation.Constant] * len(vec3_quat_as_floats(lhs.value))
lhsInSlopes = vec3_quat_as_floats(lhs.inSlope)
lhsOutSlopes = vec3_quat_as_floats(lhs.outSlope)
rhsInSlopes = vec3_quat_as_floats(rhs.inSlope)
rhsOutSlopes = vec3_quat_as_floats(rhs.outSlope)
ipo = [Interpolation.Hermite] * len(lhsOutSlopes)
if lhs.isConstant or not rhs:
ipo = [Interpolation.Constant] * len(lhsOutSlopes)
elif lhs.isDense:
if lhs.isDense:
ipo = [Interpolation.Linear] * len(lhsOutSlopes)
elif lhs.isConstant or not rhs:
ipo = [Interpolation.Constant] * len(lhsOutSlopes)
else:
lhsInSlopes = vec3_quat_as_floats(lhs.inSlope)
lhsOutSlopes = vec3_quat_as_floats(lhs.outSlope)
rhsInSlopes = vec3_quat_as_floats(rhs.inSlope)
rhsOutSlopes = vec3_quat_as_floats(rhs.outSlope)
ipo = [Interpolation.Hermite] * len(lhsOutSlopes)
for i, (lhsInSlope, lhsOutSlope, rhsInSlope, rhsOutSlope) in enumerate(
zip(lhsInSlopes, lhsOutSlopes, rhsInSlopes, rhsOutSlopes)
):
Expand Down

0 comments on commit a12fd26

Please sign in to comment.