Exemple #1
0
        private void UpdateKeyFrameList(Motion m, float Key = -1)
        {
            _freeze = true;
            KeyFrameData.Rows.Clear();

            int CurrentRow = -1;
            if (Key == -1) Key = CurrentKeyFrame;
            foreach (MotionKeyFrames k in m.KeyFrames)
            {
                var rot = k.GetRotation();
                var tra = k.GetTranslation();
                KeyFrameData.Rows.Add(k.KeyTime, tra.X, tra.Y, tra.Z, rot.X, rot.Y, rot.Z, rot.W);
                if (k.KeyTime == Key) CurrentRow += KeyFrameData.Rows.Count;
            }
            if (CurrentRow == -1) CurrentRow += KeyFrameData.Rows.Count;
            
            KeyFrameData.ClearSelection();
            KeyFrameData.CurrentCell = KeyFrameData.Rows[CurrentRow].Cells[0];
            KeyFrameData.Rows[CurrentRow].Selected = true;
            CurrentKeyFrame = (float)KeyFrameData.Rows[CurrentRow].Cells[0].Value;
            txtCurrentKey.Text = KeyFrameData.Rows[CurrentRow].Cells[0].Value.ToString();
            m.CurrentKeyTime = CurrentKeyFrame;
            _freeze = false;
        }