Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Character Cloth with Final IK (with GIFs)
#6
(15-04-2019, 10:07 AM)Partel Lang Wrote: Hey, developer of Final IK here...

ObiCloth disables the Animator and updates it via ObiAnimatorController when the Obi solver begins, then feeds the results to the cloth for processing. That does not allow Final IK to be updated after the animation and before the cloth simulation, so it will be out of sync no matter how you set up the Script Execution Order.

So basically, you will need to make sure that whenever Animator is updated, Final IK will also be updated and that must be before the cloth solver begins. To do that, you'll need to make a few changes to ObiAnimatorController.cs.
First, add 
Code:
using RootMotion.FinalIK;
to the top of the file. It will not compile, because Obi uses assembly definition files. So you'll also need to create assembly definitions for Final IK:

1. Add a new assembly definition file (Create/Assembly Definition) to Plugins/RootMotion, name it "RootMotion". Then another one to Plugins/RootMotion/Editor, name it "RootMotionEditor". 
2. Select the RootMotionEditor.asmdef file, add RootMotion.asmdef to the Assembly Definition References, deselect every platform except Editor.
3. Go to Obi/Scripts/Obi.asmdef and add RootMotion.asmdef to it's Assembly Defition References.
4. If you get an error about some ScriptableObject stuff when you select an object with IK, just right-click on Plugins/RootMotion and select Reimport, it's a Unity bug.

Now you can reference RootMotion scripts from Obi scripts. continue to edit ObiAnimatorController like so:

1. Add this:


Code:
public IK[] IKComponents;

       private void Start()
       {
           foreach (IK ik in IKComponents)
           {
               ik.enabled = false;
           }
       }

2. Add this to the line just after animator.Update(updateDelta);

Code:
foreach (IK ik in IKComponents)
               {
                   ik.GetIKSolver().Update();
               }

3. Assign all the IK components you wish to use to the ObiAnimatorController in the Editor.


That makes sure the IK components get updated in sync with Obi.

Hi Pärtel
What to do with VRIK? Invoking IK Update from somewhere else seems to make my avatar want to walk towards the ceiling. Anyways I don't have an Animator.
Sort of same thing like when I turn Fix Transform off.
Thank you for trying to help us out with this.
Reply


Messages In This Thread
RE: Character Cloth with Final IK (with GIFs) - by Jim Rankenberg - 19-04-2019, 05:02 PM