diff --git a/src/AtomAnimations/Animations/AtomAnimation.Playback.cs b/src/AtomAnimations/Animations/AtomAnimation.Playback.cs index 43c64d20..44cf3a2b 100644 --- a/src/AtomAnimations/Animations/AtomAnimation.Playback.cs +++ b/src/AtomAnimations/Animations/AtomAnimation.Playback.cs @@ -355,6 +355,7 @@ public void StopAll() { StopClip(clip); } + playTime = 0f; foreach (var clip in clips) { clip.Reset(false); diff --git a/src/AtomAnimations/Operations/RecordOperations.cs b/src/AtomAnimations/Operations/RecordOperations.cs index 696d7b7c..b6f1100e 100644 --- a/src/AtomAnimations/Operations/RecordOperations.cs +++ b/src/AtomAnimations/Operations/RecordOperations.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -28,6 +29,12 @@ public IEnumerator StartRecording( bool exitOnMenuOpen, bool showStartMarkers) { + if (!recordExtendsLength && _clip.clipTime >= _clip.animationLength - 0.001) + { + SuperController.LogError("Timeline: Animation is already at the end; either enable extends recording or rewind."); + yield break; + } + if (_animation.recording) { SuperController.LogError("Timeline: Already recording"); @@ -225,7 +232,7 @@ private void AfterRecording(List targets) target.EndBulkUpdates(); } - _clip.clipTime = Mathf.Min(_clip.animationLength, _clip.clipTime).Snap(); + _animation.StopAll(); } private static void ClearAllGrabbedControllers(IEnumerable targets)