Ejemplo n.º 1
0
 private static void FastForwardToFrame(Node node, int frameIndex)
 {
     node.SetTangerineFlag(TangerineFlags.IgnoreMarkers, true);
     try {
         CurrentFrameSetter.FastForwardToFrame(node, frameIndex);
     } finally {
         node.SetTangerineFlag(TangerineFlags.IgnoreMarkers, false);
     }
 }
Ejemplo n.º 2
0
 public void TogglePreviewAnimation(bool animationMode, bool triggerMarkersBeforeCurrentFrame)
 {
     if (PreviewAnimation)
     {
         PreviewAnimation = false;
         CurrentFrameSetter.StopAnimationRecursive(PreviewAnimationContainer);
         if (!CoreUserPreferences.Instance.StopAnimationOnCurrentFrame)
         {
             var i = 0;
             foreach (var node in PreviewAnimationContainer.Descendants)
             {
                 node.AnimationTime = animationMode ? 0 : savedAnimationTimes[i++];
             }
             SetCurrentFrameToNode(
                 PreviewAnimationBegin, Container, animationMode
                 );
         }
         AudioSystem.StopAll();
         ForceAnimationUpdate();
     }
     else
     {
         savedAnimationTimes = new List <double>();
         foreach (var node in Container.Descendants)
         {
             savedAnimationTimes.Add(node.AnimationTime);
         }
         foreach (var node in RootNode.Descendants)
         {
             if (node is ITangerinePreviewAnimationListener t)
             {
                 t.OnStart();
             }
         }
         int savedAnimationFrame = Container.AnimationFrame;
         PreviewAnimation = true;
         if (triggerMarkersBeforeCurrentFrame)
         {
             SetCurrentFrameToNode(0, Container, true);
         }
         Container.IsRunning = PreviewAnimation;
         if (triggerMarkersBeforeCurrentFrame)
         {
             FastForwardToFrame(Container, savedAnimationFrame);
         }
         PreviewAnimationBegin     = savedAnimationFrame;
         PreviewAnimationContainer = Container;
     }
     Application.InvalidateWindows();
 }
Ejemplo n.º 3
0
 public static void SetCurrentFrameToNode(int frameIndex, Node node, bool animationMode, bool isForced = false)
 {
     CurrentFrameSetter.SetCurrentFrameToNode(frameIndex, node, animationMode, isForced);
 }