diff --git a/src/AtomAnimations/Animations/AtomAnimation.Clips.cs b/src/AtomAnimations/Animations/AtomAnimation.Clips.cs index 91b31877..12e310e7 100644 --- a/src/AtomAnimations/Animations/AtomAnimation.Clips.cs +++ b/src/AtomAnimations/Animations/AtomAnimation.Clips.cs @@ -32,7 +32,7 @@ public AtomAnimationClip GetClip(string animationSegment, string animationLayer, public AtomAnimationClip AddClip(AtomAnimationClip clip) { - if (_playingAnimationSegment == null) playingAnimationSegment = clip.animationSegment; + if (_playingAnimationSegment == null && clip.isOnSegment) playingAnimationSegment = clip.animationSegment; var lastIndexOfSequence = clips.FindLastIndex(c => c.animationSegment == clip.animationSegment); var lastIndexOfLayer = clips.FindLastIndex(c => c.animationLayerQualified == clip.animationLayerQualified); int addIndex; diff --git a/src/AtomAnimations/Animations/AtomAnimation.Sequencing.cs b/src/AtomAnimations/Animations/AtomAnimation.Sequencing.cs index 458b231f..25f5672a 100644 --- a/src/AtomAnimations/Animations/AtomAnimation.Sequencing.cs +++ b/src/AtomAnimations/Animations/AtomAnimation.Sequencing.cs @@ -53,7 +53,7 @@ private void ProcessAnimationSequence(float deltaTime) clip.playbackScheduledNextAnimation = null; clip.playbackScheduledNextTimeLeft = float.NaN; - if (nextClip.animationSegment != AtomAnimationClip.SharedAnimationSegment && playingAnimationSegment != nextClip.animationSegment) + if (nextClip.isOnSegment && playingAnimationSegmentId != nextClip.animationSegmentId) { PlaySegment(nextClip); } diff --git a/src/UI/Screens/AdvancedKeyframeToolsScreen.cs b/src/UI/Screens/AdvancedKeyframeToolsScreen.cs index a798cb24..90af44af 100644 --- a/src/UI/Screens/AdvancedKeyframeToolsScreen.cs +++ b/src/UI/Screens/AdvancedKeyframeToolsScreen.cs @@ -224,12 +224,12 @@ private void ClearAllConfirm() { if(animation.isPlaying) animation.StopAll(); + animationEditContext.clipboard.Clear(); while (animation.clips.Count > 0) animation.RemoveClip(animation.clips[0]); - animation.CreateClip(AtomAnimationClip.DefaultAnimationName, AtomAnimationClip.DefaultAnimationLayer, AtomAnimationClip.DefaultAnimationSegment); - animation.playingAnimationSegment = AtomAnimationClip.DefaultAnimationSegment; - animationEditContext.SelectAnimation(animation.clips[0]); - animationEditContext.clipboard.Clear(); + var clip = animation.CreateClip(AtomAnimationClip.DefaultAnimationName, AtomAnimationClip.DefaultAnimationLayer, AtomAnimationClip.DefaultAnimationSegment); + animation.playingAnimationSegment = clip.animationSegment; + animationEditContext.SelectAnimation(clip); animationEditContext.locked = false; animationEditContext.snap = AtomAnimationEditContext.DefaultSnap; animationEditContext.showPaths = true;