Search Unity

FINAL IK - Full Body IK, Aim, Look At, FABRIK, CCD IK... [1.0 RELEASED]

Discussion in 'Assets and Asset Store' started by Partel-Lang, Jan 15, 2014.

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I test all major versions from 5.3.6 up.
    Just tested on 2017.2.2 to make sure, still not seeing it. Also tried parenting a sphere with collider and kinematic rigidbody. Were you just attaching a collider to the head bone or did you do it some other way? Do you have any script on that?

    Does it help if you set Animator's update mode to "Animate Physics"?

    Hey,
    Do you have locomotion enabled in VRIK? Because that's the only thing moving the root of the character. Might help narrowing down the issue.

    I've tested VRIK extensively in real games, never seen that issue appear though, so it would help immensely if I could get some kind of a repro from you guys.

    Best,
    Pärtel
     
  2. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    In SolverManager::UpdateSolverExternal you have:

    if (!enabled) return;

    I manually update all of my solvers, including in this case, derived HandPosers. I've had to comment out this line so I could disable the component and update it manually. Is there a better way to do this?
     
  3. warreneng

    warreneng

    Joined:
    Mar 13, 2017
    Posts:
    8
    Thanks for your guidance. I'm going to try this out today. Right now I'm using VRIK 1.6 solely for good arm/shoulder solving, but I'm using Mecanim animation to animate the rest of the player's body. The observable difference between 1.6 and 1.7 is that the player now has a bend in the spine when crouching. I liked how my animation blending had already solved the pose, but there seems to be no way to disable VRIK 1.7 spine solving. This happens even when I give the VRIK component no references to the head/spine bones. Could this be the update to IKSolverVRSpine?
     
  4. MariusRu

    MariusRu

    Joined:
    Oct 15, 2015
    Posts:
    33
    Hi Pärtel,

    I'm trying to instantiate characters with FBBIK at runtime as discussed here: https://groups.google.com/forum/#!msg/final-ik/0gtnAIMBYnU/35knbZczBwAJ
    While adding the FBBIK component works well, I encountered a problem when creating the head effector IK. Unity gives me this error:

    NullReferenceException: Object reference not set to an instance of an object
    RootMotion.FinalIK.FBBIKHeadEffector.Awake () (at Assets/FinalIK/RootMotion/FinalIK/IK Solvers/FBBIKHeadEffector.cs:121)
    UnityEngine.GameObject:AddComponent()
    GenericIK:Start() (at Assets/RuntimeIK.cs:53)

    Line 53 in RuntimeIK.cs is this:
    HeadTarget.AddComponent<FBBIKHeadEffector>();

    Interestingly, my HeadTarget does get an FBBIKHeadEffector in the inspector before the error is thrown. Is there an obvious reason for this, or do you need my full code?

    Thanks,
    Marius
     
  5. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Ok, normally you manually update IK solvers by disabling the component and calling ik.solver.Update();
    Is the problem that you also need to manually update the HandPoser too?

    Please add this code to Poser.cs:
    Code (CSharp):
    1.  
    2. /// <summary>
    3.         /// For manual update of the poser.
    4.         /// </summary>
    5.         public void UpdateManual() {
    6.             UpdatePoser();
    7.         }
    8.  
    9.  
    Hey,
    Ok I see.. There were some changes to the spine solver because it sometimes bent the spine the wrong way when crouching. I might extract the arm solver of VRIK the same way I did with the LegIK component. Would be more efficient than running the whole VRIK with parts disabled.

    Hey,
    Please update FIK, this problem was fixed with version 1.7.

    Cheers,
    Pärtel
     
    Last edited: Apr 10, 2018
    warreneng likes this.
  6. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Right. I was just asking since it felt like "UpdateExternal" was essentially meant to be what you are proposing with UpdateManual (). Will you be adding UpdateManual to the API for the next update? If so I will just add that code and use that from now on.

    While we are discussing it, could you make "children" and "StoreDefaultState ()" protected in HandPoser so I can override InitiatePoser without having to change code?

    Finally, can you remove the warnings in FinalIK / samples before you release? Every release I have to pragma out all these warnings, and it would take you, maybe five minutes, to clear them up on your side :). Thanks!
     
  7. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    I was putting a demo together for a vr meetup tonight using the finalik leap motion integration. I'm using a vive, and the vrik leap motion integration. After updating rotation offsets for hands and figers, if i face one direction everything lines up:
    upload_2018-4-10_15-40-28.png

    When I look at my hands, with fingers pointing straight up, and rotate my body 360 degress around though, the hands on my wrists stay stationary. So if i spin clockwise, they appear to spin counterclockwise, because they are not rotating. I've tried adjusting a lot off offset rotations, with no success so far.

    uploaded test scene, only needs final ik and vrik package in project to run.
     

    Attached Files:

  8. MariusRu

    MariusRu

    Joined:
    Oct 15, 2015
    Posts:
    33
    You're right, updating to 1.7 solved the problem. Thanks!
     
  9. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    90
    It doesn't help. At this point, I feel like I have tried everything and have even broken my puppet master slightly where it seems really jittery. If you could take a look I have sent you the project in PM. Thank you, and sorry for the trouble.
     
  10. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    Hi, we are currently using FinalIK for our space sim. The pilot uses a FullBodyBipedIK with effectors in both hands and head. It has four spine bones and we set all reach to 0.

    In the profiler we are getting 1 ms total aggregating FinalIK calls in hardware equivalent to current gen consoles , which is an eighth of our logic budget, is this to be expected with just one character?
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Yeah, I've added those changes to the next version, also children and StoreDefaultState.

    Which warnings were you referring to? I only see a bunch of demo asset import warnings like "File 'Anim MP-40 Standing Front' has rig import warnings. See Import Messages in Rig Import Tab for more details." that show up just once when you import FIK. I'd love to get rid of them, but to my knowledge those can't be pragmad out.

    Hey,
    VRIKLeapMotion script is outdated by now. This is the latest package. It uses VRIKHand.cs instead, please check the demo scene in that. That package was originally made for the previous version of Leap Core Assets, but they have new core assets out now (4.3.4). The script errors introduced with that update in the integration package have been fixed, but I can't really verify it still works as my Leap device has just stopped working altogether.

    Hey,
    I'll take a look at the project you sent me, hold on..

    Hey,
    Not really familiar with the details of console performance, but on a i7 processor you could expect a single instance of FBBIK with the head efftor to take about 0.16ms (SolverManager.LateUpdate + SolverManager.Update in the Profiler). If you disable "Hands Pull Body" in the FBBIKHeadEffector, it goes down to 0.08ms.

    1 ms sounds a lot in that light. Does anything in particular take unproportionately long when you deep profile and expand SolverManager.LateUpdate?
     
  12. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    I tested again with hands pull body disabled. In my computer with an i7-2600, it gives me 0.2 ms with normal profiler, and 0.7 ms with deep profile.

    In the deep profile, it is distributed between IKSolverFullBiped.ReadPose at 0.27ms, IKSolverFullBody.Solve at 0.24ms and IKSolverFullBiped.WritePose at 0.1ms. Below that it is mostly distributed uniformly over the calls.
     
  13. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    I just cleared out the old package, and pulled in the new one you posted. It looks like the protection level on handedness may have changed with the current leap motion package: upload_2018-4-12_14-16-45.png \

    side note, editing their sdk and making it public again resolves that issue, just tested the package with current leapmotion and 2017.2 and all seems good. Thanks again.
     
    Last edited: Apr 12, 2018
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Could you try what the Profile says if you just make a new scene, add FBBIK without the head effector?
    Hey,

    Oh, forgot to mention that, the change you made was the right change to make.

    Cheers,
    Pärtel
     
  15. Yurijh

    Yurijh

    Joined:
    Nov 4, 2016
    Posts:
    15
    Hello, I'm trying to create a climbing system using Final IK,
    everything works good but I would like the capsule collider & rigidbody to follow the pivot of the character's mesh. What happens now is that my character climbs correctly but the capsule and rigidbody stay back. Could you suggest the right approach?

    Thank you
     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Sure, just turn the rigidbody kinematic and move it via script. You could use
    Code (CSharp):
    1. Vector3.Lerp(ik.solver.leftFootEffector.position, ik.solver.rightFootEffector.position, 0.5f)
    or something like that to approximate it's position.
     
  17. kokkorollo

    kokkorollo

    Joined:
    Jan 16, 2013
    Posts:
    9

    Hi Pärtel, Yes, we have locomotion enabled in VRIK.
    I will try to make a video of the problem to let you know where is the problem.
    We are using microsoft immersive reality Lenovo explorer as headset.
     
  18. warreneng

    warreneng

    Joined:
    Mar 13, 2017
    Posts:
    8
    I would really like that functionality, actually. VRIK's arms are great. It's the rest of the body solvers I'm trying to disable.
     
  19. Paratope

    Paratope

    Joined:
    Jun 27, 2017
    Posts:
    20
    Hi Partel,

    We are using VRIK within our game, and am facing a problem on OVR specifically (not on SteamVR). The player body seems to be stuck on it's y-axis position, and doesn't seem to be following the Tracked Rig. If you go up or down a slope then the IK rig will not follow the y-axis position (it will either be above or below the camera). No such issues occur on SteamVR. Any thoughts on the matter would be appreciated.
     
  20. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    Using the VRIKLeapMotion434 package you posted on a morph3d model, the hand and finger rotations are offset, but the offset options that were in the old package don't exist in the new package, Can you add those offsets back in so they'll work with other models as well.

    Thanks
     
  21. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    I looked at it some more today and saw the bones are not the same after pulling the gun out as they are before the gun is pulled out. The "Fix Transforms" does have something to do with it because when I activate the aimIK for a frame with the fix transforms checked the aim corrects to the proper location, but if I don't have the fix transforms checked when activating aimIK for a frame the aim doesn't correct to the proper location. How could I force the fix transforms in my update script or is there another way to handle this issue?
     
  22. CptDustmite

    CptDustmite

    Joined:
    Jun 17, 2014
    Posts:
    61
    Hi Partel

    I have set up a VRIK character so I could record animations using VR gear. I recorded the head/hands effector target positions into an animation clip.

    Currently it looks good except for the elbow "popping". I suspect the character's arms are shorter than my own hands + controller length. So when I extend my arm it fully extends the character's arm into totally straight. This results in the elbow popping to fully straight.

    How can I put a rotation limit on the elbow so it never goes to fully straight, it's always partially bent? I tried putting Rotation Limit Angle component on the lower arm bone, but it does not seem to have any effect.

    Thanks
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey, It's gonna take some time to develop, so I added it to my todo list for the next update.

    Hey,
    VRIK doesn't move the root vertically. It just doesn't know the height to follow. If you want it to follow the tracked rig gameobject, you'll have to do it by script.

    Code (CSharp):
    1. ik.references.root.position = new Vector3(ik.references.root.position.x, trackedRig.position.y, ik.references.root.position.z);
    Hey,
    The new version just uses a different method for the finger rotations so I can't add them back. It might be that the "Palm To Thumb Axis" and "Wrist To Palm Axis" are wrong in VRIK arm settings for that character. Could you right-click on VRIK header and select "Guess Hand Orientations" from the context menu?

    Code (CSharp):
    1. ik.solver.FixTransforms();
    That rotates the bones back to how they were at Start, which is what FIK components normally do in each Update when they are enabled and "Fix Transforms" is checked.

    Hey,
    The latest version of VRIK has automatic hand stretching. It is disabled by default, but you can go into the "VRIK (Basic)" demo scene and copy the "Stretch Curve" over from the Pilot, it's under VRIK's arm settings. Note that there is also "Arm Length Mlp" that you can use to reproportion your arms. The next version will also add leg stretching.

    Cheers,
    Pärtel
     
  24. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,978
    Your asset has been reported to be ILEGALLY bundled with a bunch of stolen assets, please comment here to support punitive action against them once and for all:

    EDIT: all users please comment on this thread to support action against this user: https://forum.unity.com/threads/stolen-assets-scam-master-anim-system.527329/

    Also heard puppetmaster is also in there.

    EDIT2: I mean your asset is stolen by another developer.

    Realized I wrote this a little unclear, i mean to help you as the original author of the assets, not punish you for being stolen from! XD
     
    Last edited: Apr 18, 2018
  25. Paratope

    Paratope

    Joined:
    Jun 27, 2017
    Posts:
    20
    Thanks Partel, that did the job.
     
  26. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    I tried in an empty scene with no effectors and it still gives me 0.17 ms:
    Captura.PNG
     
  27. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello What Could make shake Aim Ik ? it shake every time a move i am target ?
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Thanks for the information!
    As you said, they keep consistently popping up and I'm sure it'll happen again and again. Which is why I don't bother banging my head against a brick wall, I just consider it free marketing work and rather spend the time developing my stuff further.

    It also depends on how many of the effectors are used and other solver parameters (more info here under the "Optimizing FullBodyBipedIK section). You can also set Iterations to 0, which will disable the full body effect that is unnecessary in many cases.

    If it shakes, that means something is out of sync with the AimIK update cycle. Could be the animation or the camera. If it's animation, it could happen if you have the Animator in "Animate Physics" update mode and you are updating a disabled AimIK manually by calling ik.solver.Update() in LateUpdate. Then the animation would play in fixed time step, but IK in floating time step, creating jitter. It could also be the update order of Camera and IK. For example if you set AimIK target relative to camera rotation, IK gets solved, then camera update happens after all that moving/turning the camera away, your IK will lag a frame behind and will be causing jitter too.

    The best way to debug shakiness/jitter would be to turn the Time Scale down to a very low value so you could see exactly what's happening in slow motion.

    Best,
    Pärtel
     
    hopeful and MadeFromPolygons like this.
  29. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,978
    Fair enough just thought you might want to know :)
     
    Partel-Lang likes this.
  30. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
     
  31. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    Thankssss That was it ! animator ^^
     
  32. sonamnegi

    sonamnegi

    Joined:
    Feb 8, 2018
    Posts:
    2
    I was trying out VRIK-leap demo.I am using Final Ik,leap motion sensor to track my hands.
    Issue: the way avatars wrist looks when i change my hand position is not normal.
    Looks like the wrist is rotation 360 deg. The forearm seems to remain static.
    Overall hand rotation results in some unnatural positions.

    Question:Is there a way to improvise such scenarios, I am not sure if I am overlooking something which might help?.

    Thank You.
     

    Attached Files:

  33. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    I'm having trouble getting the AimIK to update when I'm rotating the entire character in a circle quickly. The problem happens when spinning very quickly then when I stop spinning the AimIK is off center and wont correct back to the neutral position. If I allow my character to rotate faster this issue doesn't happen, but I would prefer the slower rotation because it looks more natural.

     
  34. pnuzhdin

    pnuzhdin

    Joined:
    Mar 26, 2018
    Posts:
    3
    Hi,

    I am using VRIK with Leap Motion and unable to fix several weird issues for the free mixamo models (this one is Liam https://www.mixamo.com/#/?page=1&query=liam&type=Character):
    * Forearms don't match Leap Motion hands rotation, so they look broken.
    * Fingers don't match Leap Motion fingers so interaction might not be so natural.
    Could you help?
    Screen Shot 2018-04-24 at 16.49.23.png
     
    Last edited: Apr 24, 2018
  35. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    Ok, I tweaked it a bit more and got it to take just 0.18 ms in PS4, setting iterations to 1, for such a central thing in our game it's acceptable!
     
  36. CherryEngine

    CherryEngine

    Joined:
    Sep 10, 2015
    Posts:
    19
    Hey, I've got 2 problems that I can not solve. The first is the torso is turned right slightly. The hand on this side is also like a more twisted one and it differently animates when moving - left is ok.
    Second problem is that hands sometimes loose connection with grip (for some angles). I would like to have it sticked to grips - so it is always in the same position and it's not moving. 1.2.png 5.png
     
  37. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I too have a slight rotation offset with VRIK, and sometimes notice that my character's left leg is slightly longer than the right leg.

    I have taken care to model my characters with perfect symmetry, even when I apply an animation generated by the same character standing in tpose it still appears to be present...
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Looks like the hand position relative to the head is wrong, I mean either you have longer arms than the avatar or the camera position should be closer to the hand. Anyway the wrist looks like that because the arm is too short to reach the target so the arm will be fully extended, not bent.

    Hey,
    How are you rotating the AimIK target around the character? Or is it the AimController doing that?

    Hey,
    Is this with the latest integration package that uses VRIKHand instead of VRIKLeapMotion script?
    The wrist twisting issue could be fixed with adding the TwistRelaxer component to the forearm roll bone or the forearm if you don't have the roll bone. Not sure what's going on with the fingers, are they not moving at all? Eny errors in the Console?

    Hey,
    Yeah, full body IK is not the cheapest procedure, although FBBIK is probably the fastest full body solver in the industry, it will still take a noticable chunk out of your CPU budget.

    Hey,
    The first problem can probably be fixed by decreasing "Rotate Chest By Hands" under the Spine settings.
    About the arms solving differently, it must be either something unsymmetric about the model or the IK target localPositions/Rotations.
    About not reaching the targets, the arms of the model must be too short. I suggest you either scale up the character, increase the "Arm Length Mlp" in the arm settings and/or use the automatic arm stretching of the latest VRIK. You can do that by going to the "VRIK (Basic)" demo and copying over the "Stretch Curve" from the Pilot to your own character.

    Hey,
    Please see the answer above about the chest rotation offset.
    There is no way the current VRIK version can make one of the legs longer. It only rotates the leg bones, never adjusts their scale or position. Unless I have sent you the latest WIP version that introduces automatic leg stretching.

    Best,
    Pärtel
     
  39. CherryEngine

    CherryEngine

    Joined:
    Sep 10, 2015
    Posts:
    19
    How can I solve that or at least check what is wrong? I've put different animations in that model and it was working fine?
    What about that IK targets? how it should be done?
     
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Put your character to (0, 0, 0) add a new gameobject to the hand bone at (0, 0, 0) localPosition. Then unparent it, and invert it's position X value, see if it has jumped to the other handp properly. If it's not, the arms of the model are unsymmetric. That should not be a problem for the IK, but might explain the arms behaving differently.

    About the IK targets, not sure as I don't know how you have set them up. Could be something unsymmetric there.

    It could also be that the "Wrist To Palm Axis" and/or "Palm To Thumb Axis" are wrong for one of the arms. That usually happens when you copy VRIK over from one character to another that has different bone orientations and causes weird elbow behaviour. You can right-click on VRIK header and select "Guess Hand Orientations" from the context menu to have VRIK update those values for you and check if it guessed right by looking at the hand bone axes in Local space.
    Wrist To Palm Axis is the local axis of the hand bone that points from the wrist towards the palm and the other is the axis pointing from the palm towards the thumb.
     
  41. CherryEngine

    CherryEngine

    Joined:
    Sep 10, 2015
    Posts:
    19

    Hey,
    Thank you for your answer. I checked and the model is perfectly symmetrical
    1.png
    2.png
    (it looks also good from front)
    I've made "Gueass Hand Orientations" at the beginning.
    About "Wrist To Palm Axis" and/or "Palm To Thumb Axis" it looks like that:
    3.png
     
  42. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Could you please send me that character fbx via PM or support@root-motion.com so I could take a closer look?
     
  43. ropemonkey

    ropemonkey

    Joined:
    Apr 28, 2014
    Posts:
    6
    @partel-lang For manual height calibration in VRIK, I took a stab at following post #3384795. I noticed that when the ground isn't at y=0 that the scaling didn't seem to be correct. But when I took that into account, it got better. It also seemed to get rid of the double Calibrate call behavior that @fairennuff was seeing. Could be my setup / inexperience with FinalIK, but in case someone is seeing something similar.

    var footY = ik.references.leftFoot.position.y;
    float sizeF = (ik.solver.spine.headTarget.position.y - footY) / (ik.references.head.position.y - footY);
    root.localScale *= sizeF;
     
  44. Zrob

    Zrob

    Joined:
    Jan 13, 2017
    Posts:
    9
    Hi,

    for VRIK, I'm trying to use my own walking animation when I move, since the walking is a big wonky with my movement system. In my system players lean forward to move and so the walk looks really funky, especially at high speeds.

    Also, how do I get the arms to not clip into the body, using constraints etc?
     
  45. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    Pretty sure I have seen PuppetMaster solve this issue before.
     
  46. CherryEngine

    CherryEngine

    Joined:
    Sep 10, 2015
    Posts:
    19
    THANK YOU! for great support!
     
  47. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    90
    Yeah if you get PuppetMaster Partel has already implemented a VRIK and PuppetMaster with collisions so you can keep limbs from going through each other. I am using it and it works really well.
     
  48. Zrob

    Zrob

    Joined:
    Jan 13, 2017
    Posts:
    9
    Thank you. With PupperMaster, what do I need to do to do this? Any guides pointing to it? Thanks.
     
  49. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    90
    ah yeah, you're right. I deleted my comment if you could remove your reference too, please. Sorry about that Partel.
     
  50. Zrob

    Zrob

    Joined:
    Jan 13, 2017
    Posts:
    9
    Done!