Answered

How to properly make use of UMotion Pro along with Final-IK

Anonymous 1 month ago updated by Peter - Soxware Developer 1 month ago 7

Hi There ! I would like to understand how to properly make use of UMotion Pro, along with Final-IK. I mainly aim to take advantage of Final-IK's "Biped IK Solvers" to create the key poses needed by the animations even more easily & faster. I've tried to add the CallBack "UpdateSolver" as mentioned in the docs... but didn't see any changes... please help !

UMotion Version:
Unity Version:

Answer

Answer
Answered

Hi,
thank you very much for your support request.


  1. Create your IK rig outside of UMotion (using Final IK). You need to use dedicated game objects as IK goals (the Final IK gizmos can't be animated by UMotion).
  2. Make sure that everything works: Enter play mode and drag the IK targets around. The character should change it's pose properly.
  3. Then back in UMotion, set the callback name (Pose Editor --> Options) to "UpdateSolver" (you did that already correctly). UMotion should now be executing the Final IK scripts at edit time.
  4. In UMotion's config mode, make the custom IK goals visible (you can also configure their appearance).
  5. (Optional) Use custom property constraints to control the properties of the Final IK solver from within your animation.
  6. Back in Pose Mode, moving the IK goals should correctly modify your character (like previously in play mode).

Please let me know in case this doesn't work for you.

Best regards,
Peter

Answer
Answered

Hi,
thank you very much for your support request.


  1. Create your IK rig outside of UMotion (using Final IK). You need to use dedicated game objects as IK goals (the Final IK gizmos can't be animated by UMotion).
  2. Make sure that everything works: Enter play mode and drag the IK targets around. The character should change it's pose properly.
  3. Then back in UMotion, set the callback name (Pose Editor --> Options) to "UpdateSolver" (you did that already correctly). UMotion should now be executing the Final IK scripts at edit time.
  4. In UMotion's config mode, make the custom IK goals visible (you can also configure their appearance).
  5. (Optional) Use custom property constraints to control the properties of the Final IK solver from within your animation.
  6. Back in Pose Mode, moving the IK goals should correctly modify your character (like previously in play mode).

Please let me know in case this doesn't work for you.

Best regards,
Peter

Many Thanks !!! I see it working now. 


but about step (5): <<, use custom property constraints to control the properties of the Final IK solver from within your animation...>> :    I only see two properties displayed : "enabled" and "fix transform" is it normal? , or am I doing wrong? are they some other properties that can be animated or displayed ?

edit : "is there some other properties that can be animated or displayed ?" ( sorry for misspelling)

What Final IK component do you want to animate with the custom property constraint (and what property is it that you want to control but is not visible to the custom property constraint)?

ok, let me explain: I have created a "Custom Property" named "Final_IK_Property" I've put in the Object slot my character with Final IK main solver component on it. in property field, I've selected "BipedIK.enabled". and set input Min/Max to 0-1... I'd like to set the value of this custom property from my own editor script. and also be able to add a key pose in the timeline from script too.

Also, is it possible to rotate each limb/bones with a method from an editor mode script, to match a wanted pose and then record everything in a keypose for UMotion? (From an editor Mode script)... how to ?

"is there some other properties that can be animated or displayed ?
I've selected "BipedIK.enabled". and set input Min/Max to 0-1...

Ok I've checked the Biped IK script. There are indeed other properties that would make sense to animate (like the position/rotation weight properties of each solver,...) but the Unity animation system can not reference these properties because they are nested in sub-classes. I double checked with Untiy's built in animation window, you also can't add animation curve for those properties there.


It's however easy to workaround this limitation. Just add a variable in the Biped IK script for each property you want to "expose" to the animation system. In BipedIK.UpadateSolver() you simply write the current content of your exposed property to the real property:

        public float leftFootPositionWeight = 0f; // MODIFICATION: exposed property for animating

        /*
         * Updates the solvers. If you need full control of the execution order of your IK solvers, disable this script and call UpdateSolver() instead.
         * */
        protected override void UpdateSolver() {

            solvers.leftFoot.IKPositionWeight = leftFootPositionWeight; // MODIFICATION: use the value of the animated property

            // Storing Limb bend and rotation before %IK
            for (int i = 0; i < solvers.limbs.Length; i++) {
                solvers.limbs[i].MaintainBend();
                solvers.limbs[i].MaintainRotation();
            }
            
            // Updating constraints
            solvers.pelvis.Update();
            
            // Updating %IK solvers
            if (solvers.spine.bones.Length > 1) solvers.spine.Update();
            solvers.aim.Update();
            solvers.lookAt.Update();
            for (int i = 0; i < solvers.limbs.Length; i++) solvers.limbs[i].Update();
        }


Now you can select the "leftFootPositionWeight" property when setting up the UMotion custom property constraint.

I'd like to set the value of this custom property from my own editor script. and also be able to add a key pose in the timeline from script too
Also, is it possible to rotate each limb/bones with a method from an editor mode script, to match a wanted pose and then record everything in a keypose for UMotion? (From an editor Mode script)... how to ?

UMotion has a dedicated scripting API (see manual chapter "UMotion API") but I'm afraid the things you are trying to accomplish are currently not supported. I will consider extending the API in future versions but can't promise anything as of right now.

Best regards,
Peter