Skip to content

Commit

Permalink
Allow cut keyframe of triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
acidbubbles committed Apr 9, 2024
1 parent 08a8d5c commit 5bd8234
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/AtomAnimations/Editing/AtomAnimationEditContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,16 @@ public void Cut()
clipboard.Clear();
clipboard.time = time;
clipboard.entries.Add(entry);
if (time.IsSameFrame(0f) || time.IsSameFrame(current.animationLength)) return;
foreach (var target in GetAllOrSelectedTargets())
foreach (var target in current.targetTriggers)
{
target.DeleteFrame(time);
if (time.IsSameFrame(0f))
target.CreateKeyframe(0);
if (time.IsSameFrame(current.animationLength))
target.CreateKeyframe(current.animationLength.ToMilliseconds());
}
if (time.IsSameFrame(0f) || time.IsSameFrame(current.animationLength)) return;
foreach (var target in GetAllOrSelectedTargets().OfType<ICurveAnimationTarget>())
{
target.DeleteFrame(time);
}
Expand Down

0 comments on commit 5bd8234

Please sign in to comment.