public SSAnimationStateMachineSkeletalController addStateMachine(SSAnimationStateMachine description,
                                                                         int[] topLevelJoints = null)
        {
            var smController = new SSAnimationStateMachineSkeletalController(description, topLevelJoints);

            addController(smController);
            return(smController);
        }
        /// <summary>
        /// Adds the state machine that will control the mesh.
        /// </summary>
        /// <param name="stateMachine">
        /// A runtime state machine component that can be used to trigger animation state transitions on demand,
        /// from keyboard etc.
        /// </param>
        public SSAnimationStateMachineSkeletalController addStateMachine(
            SSAnimationStateMachine stateMachine)
        {
            var newSMRuntime = new SSAnimationStateMachineSkeletalController(stateMachine);

            _channelControllers.Add(newSMRuntime);
            return(newSMRuntime);
        }
        /// <summary>
        /// This can be used to loop an animation without having to set up a state machine explicitly
        /// For a more sophisticated control use AddController()
        /// </summary>
        public void playAnimationLoop(SSSkeletalAnimation anim, float transitionTime = 0f,
                                      int[] topLevelJoints = null)
        {
            _hierarchy.verifyAnimation(anim);
            var loopSM = new SSAnimationStateMachine();

            loopSM.addState("default", anim, true);
            loopSM.addAnimationEndsTransition("default", "default", transitionTime);
            if (topLevelJoints == null)
            {
                topLevelJoints = _hierarchy.topLevelJoints;
            }
            var loopController = new SSAnimationStateMachineSkeletalController(loopSM, topLevelJoints);

            addController(loopController);
        }