예제 #1
0
        void _control_Animation_FixedBoneChanged(object sender, FixedBoneChangeEventArgs e)
        {
            //Recalculate animation....
            int[] animationOrder = _acf.getAnimationOrder();
            int   numFrames      = _acf.NumberStepsPerPositionChange;

            SetupWristDistancesForAnimation(e.BoneIndex, animationOrder, numFrames, (double)_acf.DistanceMapMaximumValue, _acf.GetContourDistancesToCalculate(), _acf.GetContourColorsToCalculate());
            _fullWrist.SetupWristForAnimation(e.BoneIndex, animationOrder, numFrames);
            updateAnimationFrame(); //make certain we are on the correct frame...
        }
예제 #2
0
        private void startFullAnimation(AnimationCreatorForm acf)
        {
            _acf = acf;
            int[] animationOrder = acf.getAnimationOrder();
            int   numFrames      = acf.NumberStepsPerPositionChange;

            _animationControl = new AnimationControl();
            _layoutControl.addControl(_animationControl);

            int totalNumFrames = numFrames * (animationOrder.Length - 1) + 1;

            _animationControl.setupController(totalNumFrames);
            _animationControl.FPS = 10;

            //little bit of gui stuff
            if (_layoutControl.Contains(_positionGraph))
            {
                _layoutControl.removeControl(_positionGraph);
            }
            _wristControl.changeToAnimationMode();

            int startingFixedBone = (int)WristFilesystem.BIndex.RAD; //default to fixing to the radius...

            //now, lets go and add the switches into place
            SetupWristDistancesForAnimation(startingFixedBone, animationOrder, numFrames, (double)acf.DistanceMapMaximumValue, acf.GetContourDistancesToCalculate(), acf.GetContourColorsToCalculate());
            _fullWrist.SetupWristForAnimation(startingFixedBone, animationOrder, numFrames); //default to radius fixed...
            _fullWrist.SetToAnimationFrame(0);                                               //set us to the first frame

            //redirect change in fixed bone....
            _wristControl.FixedBoneChanged -= new FixedBoneChangedHandler(_control_FixedBoneChanged);
            _wristControl.setFixedBone(startingFixedBone); //do this while no one is listening
            _wristControl.FixedBoneChanged += new FixedBoneChangedHandler(_control_Animation_FixedBoneChanged);
            _wristControl.ShowHamChanged   += new ShowHamChangedHandler(_wristControl_ShowHamChanged);

            _animationControl.TrackbarScroll += new AnimationControl.TrackbarScrollHandler(_animationControl_TrackbarScroll);
            _animationControl.StopClicked    += new AnimationControl.StopClickedHandler(_animationControl_StopClicked);
            _animationControl.PlayClicked    += new AnimationControl.PlayClickedHandler(_animationControl_PlayClicked);
            _animationControl.FPSChanged     += new AnimationControl.FPSChangedHandler(_animationControl_FPSChanged);

            _animationTimer          = new Timer();
            _animationTimer.Tick    += new EventHandler(_animationTimer_Tick);
            _animationTimer.Interval = (int)(1000 / (double)_animationControl.FPS);
        }