public void EnableAnimationSuite()
        {
            var vessel = FlightGlobals.ActiveVessel;

            if (vessel.evaController == null)
            {
                ScreenMessages.PostScreenMessage(new ScreenMessage("<color=" + Colors.DefaultMessageColor + ">Active vessel must be an EVA to use the Animation Suite</color>", 3f, ScreenMessageStyle.UPPER_CENTER));

                //set the button back to false
                toolbarControl.SetFalse(false);
                return;
            }

            Kerbal        = new SelectedKerbalEVA(vessel.evaController);
            AnimationClip = new EditableAnimationClip(Kerbal);

            if (!Kerbal.EnterAnimationMode())
            {
                //wipe the state
                Kerbal        = null;
                AnimationClip = null;
                CurrentBone   = null;

                //set the button back to false if it failed
                toolbarControl.SetFalse(false);
                return;
            }

            MusicIsPlaying = true;
        }
        public EditableAnimationClip(SelectedKerbalEVA eva)
        {
            Kerbal = eva;
            name   = "CustomClip_" + Guid.NewGuid().ToString();

            BuildAnimationClip();
            Initialize();
        }
        public EditableAnimationClip(SelectedKerbalEVA eva)
        {
            Kerbal = eva;
            name = "CustomClip_" + Guid.NewGuid ().ToString ();

            BuildAnimationClip ();
            Initialize ();
        }
        public static void RebuildAnimationNames(SelectedKerbalEVA eva)
        {
            if (eva.Joints01Transform == null)
            {
                Debug.Log ("joints01 is null, cannot populate animation names");
                return;
            }

            string prefix = "globalMove01";
            KerbalAnimationSuite.Instance.AnimationNames = new Dictionary<string, string> ();

            PopulateAnimationNamesRecursive (eva.Joints01Transform, prefix);
        }
        public EditableAnimationClip(SelectedKerbalEVA eva, string url)
        {
            Kerbal = eva;
            name = "CustomClip_" + Guid.NewGuid ().ToString ();

            if(!url.EndsWith(".anim"))
                url += ".anim";
            ConfigNode node = ConfigNode.Load (KSPUtil.ApplicationRootPath + "GameData/" + url);
            base.Load (node);

            BuildAnimationClip ();
            Initialize ();
        }
        public static void RebuildAnimationNames(SelectedKerbalEVA eva)
        {
            if (eva.Joints01Transform == null)
            {
                Debug.Log("joints01 is null, cannot populate animation names");
                return;
            }

            string prefix = "globalMove01";

            KerbalAnimationSuite.Instance.AnimationNames = new Dictionary <string, string> ();

            PopulateAnimationNamesRecursive(eva.Joints01Transform, prefix);
        }
        public EditableAnimationClip(SelectedKerbalEVA eva, string url)
        {
            Kerbal = eva;
            name   = "CustomClip_" + Guid.NewGuid().ToString();

            if (!url.EndsWith(".anim"))
            {
                url += ".anim";
            }
            ConfigNode node = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/" + url);

            base.Load(node);

            BuildAnimationClip();
            Initialize();
        }
        public void EnableAnimationSuite()
        {
            var vessel = FlightGlobals.ActiveVessel;
            if (vessel.evaController == null)
            {
                ScreenMessages.PostScreenMessage (new ScreenMessage ("<color=" + Colors.DefaultMessageColor + ">Active vessel must be an EVA to use the Animation Suite</color>", 3f, ScreenMessageStyle.UPPER_CENTER));

                //set the button back to false
                Button.SetFalse (false);
                return;
            }

            Kerbal = new SelectedKerbalEVA (vessel.evaController);
            AnimationClip = new EditableAnimationClip (Kerbal);

            if (!Kerbal.EnterAnimationMode ())
            {
                //wipe the state
                Kerbal = null;
                AnimationClip = null;
                CurrentBone = null;

                //set the button back to false if it failed
                Button.SetFalse (false);
                return;
            }

            MusicIsPlaying = true;
        }