public void AddAnimation(STAnimation animation, bool reset = true)
        {
            if (animation == null)
            {
                return;
            }

            if (reset)
            {
                Reset();
            }

            Console.WriteLine($"Add anim " + animation.Name);

            currentAnimations.Add(animation);

            ResetModels();
            animation.Reset();
            totalFrame.Maximum                = (decimal)FrameCount;
            totalFrame.Value                  = (decimal)FrameCount;
            currentFrameUpDown.Maximum        = (decimal)FrameCount;
            animationTrackBar.ActiveAnimation = animation;
            animationTrackBar.FrameCount      = (float)FrameCount;
            currentFrameUpDown.Value          = 0;

            SetAnimationsToFrame(0);
            UpdateViewport();
        }
Example #2
0
        public void AddAnimation(STAnimation animation, bool reset = true)
        {
            if (animation == null)
            {
                return;
            }

            if (reset)
            {
                Reset();
            }

            currentAnimations.Add(animation);

            ResetModels();
            animation.Reset();
            totalFrame.Maximum                = (decimal)FrameCount;
            totalFrame.Value                  = (decimal)FrameCount;
            currentFrameUpDown.Maximum        = (decimal)FrameCount;
            currentFrameUpDown.Minimum        = (decimal)StartFrame;
            animationTrackBar.FrameCount      = (float)FrameCount;
            animationTrackBar.StartTime       = (int)StartFrame;
            animationTrackBar.ActiveAnimation = animation;
            currentFrameUpDown.Value          = (decimal)StartFrame;

            SetAnimationsToFrame(0);
            UpdateViewport();
        }
Example #3
0
        public void AddAnimation(STAnimation animation, bool reset = true)
        {
            if (animation == null)
            {
                return;
            }

            if (reset)
            {
                Reset();
            }

            currentAnimations.Add(animation);

            float frameCount = uint.MinValue;
            float startFrame = uint.MaxValue;

            for (int i = 0; i < currentAnimations.Count; i++)
            {
                frameCount = Math.Max(frameCount, currentAnimations[i].FrameCount);
                startFrame = Math.Min(startFrame, currentAnimations[i].StartFrame);
            }

            if (frameCount != uint.MinValue && frameCount > startFrame)
            {
                FrameCount = frameCount;
            }
            else
            {
                FrameCount = 1;
            }
            if (startFrame != uint.MaxValue && frameCount > startFrame)
            {
                StartFrame = startFrame;
            }
            else
            {
                StartFrame = 0;
            }

            FrameCount = (float)Math.Round(FrameCount, 0);

            ResetModels();
            animation.Reset();
            totalFrame.Maximum                = (decimal)FrameCount;
            totalFrame.Value                  = (decimal)FrameCount;
            currentFrameUpDown.Maximum        = (decimal)FrameCount;
            currentFrameUpDown.Minimum        = (decimal)StartFrame;
            animationTrackBar.FrameCount      = (float)FrameCount;
            animationTrackBar.StartTime       = (int)StartFrame;
            animationTrackBar.ActiveAnimation = animation;
            currentFrameUpDown.Value          = (decimal)StartFrame;
            frameSpeedUD.Maximum              = (decimal)animation.FrameRate * 2;
            frameSpeedUD.Value                = (decimal)animation.FrameRate;

            SetAnimationsToFrame(0);
            UpdateViewport();
        }
        public void AddAnimation(STAnimation animation, bool reset = true)
        {
            if (animation == null)
            {
                return;
            }

            if (reset)
            {
                Reset();
            }

            currentAnimations.Add(animation);

            animation.Reset();
            totalFrame.Maximum         = (decimal)FrameCount;
            totalFrame.Value           = (decimal)FrameCount;
            currentFrameUpDown.Maximum = (decimal)FrameCount;
            currentFrameUpDown.Value   = 0;
            animationTrackBar.Maximum  = (int)FrameCount;

            SetAnimationsToFrame(0);
        }