示例#1
0
        private void SetAnimation(int[] Indices, H3DDict <H3DAnimation> SrcAnims, AnimationType Type)
        {
            List <H3DAnimation> Animations = new List <H3DAnimation>(Indices.Length);

            foreach (int i in Indices)
            {
                Animations.Add(SrcAnims[i]);
            }

            if (Type == AnimationType.Skeletal && Indices.Length == 1)
            {
                foreach (H3DAnimation SklAnim in Animations)
                {
                    int MIndex = Scene.MaterialAnimations.Find(SklAnim.Name);

                    if (MIndex != -1 && !MatAnimsList.SelectedIndices.Contains(MIndex))
                    {
                        MatAnimsList.Select(MIndex);
                    }
                }
            }

            AnimGrp.Frame = 0;

            AnimGrp.SetAnimations(Animations, Type);

            AnimGrp.UpdateState();

            AnimSeekBar.Value   = AnimGrp.Frame;
            AnimSeekBar.Maximum = AnimGrp.FramesCount;

            UpdateAnimationTransforms();
            UpdateAnimLbls();
            UpdateViewport();
        }