Skip to content

Commit

Permalink
Fix crash when toggling loop in imported animations
Browse files Browse the repository at this point in the history
  • Loading branch information
acidbubbles committed Apr 9, 2024
1 parent ad531fc commit f2aae35
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/AtomAnimations/Animations/AtomAnimationClip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,15 @@ public bool loop
{
if (curve.length != 2) continue;
var keyframe = curve.GetLastFrame();
keyframe.curveType = value ? curve.GetFirstFrame().curveType : CurveTypeValues.CopyPrevious;
if (value)
{
keyframe.curveType = curve.GetFirstFrame().curveType;

}
else
{
keyframe.curveType = CurveTypeValues.CopyPrevious;
}
curve.SetLastFrame(keyframe);
}
}
Expand All @@ -324,6 +332,7 @@ public bool loop
UpdateForcedNextAnimationTime();
if (!_skipNextAnimationSettingsModified) onAnimationSettingsChanged.Invoke(nameof(loop));
DirtyAll();
onAnimationKeyframesDirty.Invoke();
}
}

Expand Down

0 comments on commit f2aae35

Please sign in to comment.