From aefe5d6d4be74b48a2da5d75ab65158e7751a951 Mon Sep 17 00:00:00 2001 From: mika10095 Date: Tue, 2 Jun 2026 13:18:44 +0200 Subject: [PATCH 1/3] fix first frame of animations being wonky --- Robust.Client/Animations/AnimationTrackProperty.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Robust.Client/Animations/AnimationTrackProperty.cs b/Robust.Client/Animations/AnimationTrackProperty.cs index f5b930e41a7..8b32c0d39ea 100644 --- a/Robust.Client/Animations/AnimationTrackProperty.cs +++ b/Robust.Client/Animations/AnimationTrackProperty.cs @@ -43,7 +43,9 @@ public override (int KeyFrameIndex, float FramePlayingTime) AdvancePlayback(obje var nextKeyFrame = keyFrameIndex + 1; if (nextKeyFrame == 0) { - // Still before the first keyframe, do nothing. + // At the start snap the anim to the first keyframe + value = KeyFrames[0].Value; + ApplyProperty(context, value); return (keyFrameIndex, playingTime); } From d970314990fc0693c1d641d6807b6515a4b6e8ed Mon Sep 17 00:00:00 2001 From: mika10095 Date: Tue, 2 Jun 2026 14:11:47 +0200 Subject: [PATCH 2/3] update tests --- Robust.Client.IntegrationTests/UserInterface/ControlTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs b/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs index e0d4344a13a..5fefe614d16 100644 --- a/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs +++ b/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs @@ -158,6 +158,7 @@ public void TestAnimations() Property = nameof(TestControl.Foo), KeyFrames = { + new AnimationTrackProperty.KeyFrame(0f, 0f), // This is the common way to specify the first keyframe. new AnimationTrackProperty.KeyFrame(1f, 1f), new AnimationTrackProperty.KeyFrame(3f, 2f) } From 52fd52ceeddd9ef0b4e888186ae1e54022354f67 Mon Sep 17 00:00:00 2001 From: mika10095 Date: Tue, 2 Jun 2026 14:17:55 +0200 Subject: [PATCH 3/3] fix tests --- Robust.Client.IntegrationTests/UserInterface/ControlTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs b/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs index 5fefe614d16..8f1d7028f6a 100644 --- a/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs +++ b/Robust.Client.IntegrationTests/UserInterface/ControlTest.cs @@ -169,7 +169,7 @@ public void TestAnimations() control.PlayAnimation(animation, "foo"); control.DoFrameUpdateRecursive(new FrameEventArgs(0.5f)); - Assert.That(control.Foo, new ApproxEqualityConstraint(0f)); // Should still be 0. + Assert.That(control.Foo, new ApproxEqualityConstraint(0.5f)); // Should be 0.5 as half a second elapsed and our 1s keyframe is at 1. control.DoFrameUpdateRecursive(new FrameEventArgs(0.5001f));