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. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Hi there.
    I'm having an annoying issue with the grounder component, for only one set of animations.
    I can walk just fine on uneven terrain, but somehow our pushing animation results frequently in feet going below the ground, like here :
    The transform of the character is correctly on ground level (shown with the position gizmo here), but both feet go below the ground, and I can't find what I'd need to tweak to fix that.
     
  2. USFHCI

    USFHCI

    Joined:
    Jun 28, 2017
    Posts:
    1
    Hi Partel-Lang,

    I have used the VRIK script to use controller to control the hands, but ran into problem that the forearms could cross each other. I added collider to both of the forearms but they still cross each other. Is there any way I could solve this problem? 1.png 2.png
     
  3. evertoon-chris

    evertoon-chris

    Joined:
    Jun 20, 2016
    Posts:
    2
    Hi! Thanks for making Final IK, it's a great package.

    I'm trying to set up a hugging rig similar to the example kissing rig. The chin of each avatar touches the shoulder of the other avatar. The goal is to support avatars with different heights and have the head's pitch tilt correctly so that the chin is always touching the same point on the other avatar.

    I tried to solve this by adding a CCDIK chain from the torso to the chin of each FBBIK avatar but the head motion ended up having a lot of jitter, and actually became more jittery when more iterations were applied per frame. Changing the order of the CCDIK and FBBIK solving didn't help. There are 6 contact points between the avatars (both hands and the chin per avatar) which might be contributing to this, but the jittering only appears when the chin CCDIK is enabled.

    Any thoughts on how to reduce jittering, or if the chin effector should be built using a different method?
     
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey Pärtel. I just noticed that many demo controlers has the IK Pass checkbox checked. I though this was a vanilla unity Ik thingy. Is it used in anyway if using Final IK?

    The only reference I can find in the code to OnAnimatorIK is for a demo showing how much better Final IK is then vanilla
     
  5. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    There is a hacky add-on script for that, please see the "Head Effector (Hand Controllers)" demo.
    But there is also a solver dedicated to VR included, please use the VRIK component.

    Hey,
    Please check the animation clip, does the problem already appear in that? If if does, it will still be there after Grounder is applied and needs to be fixed on the animation side.

    Hey,
    IK doesn't use the colliders at all, there is no way to fix that other than perhaps try to use the Swivel Offset or the Bend Goals to adjust the elbow direction.

    Hey,
    The hugging example uses multiple iterations of FBBIK, but if you iterate both FBBIK and CCDIK there might be problems as the CCD algorithm is never 100% accurate and can produce different results especially when used on top of animation. Try iterating only FBBIK and then solve CCDIK just once after all that FBBIK stuff is done.

    Hey,
    No, the IK Pass is Unity's own built in IK stuff, it doesn't relate to Final IK at all.

    Best,
    Pärtel
     
  6. dwaldrum

    dwaldrum

    Joined:
    Jun 20, 2015
    Posts:
    48
    Hi Pärtel,

    We're trying to do something a little complicated with Final IK and so far we're not having much luck. Wondering if you could maybe help us out and give us some direction how you might handle this.

    We have a character setup with Final IK, and an object similar to a shopping cart. What we are trying to do is use the interaction system to allow the character (player) to grab on to the handles of the cart when they are close. Once the character is holding the handle, somehow attach the characters hands to the handle and push/pull the cart around as the character moves. But if the cart gets pushed away from the character, or vice versa the character will let go of the cart (like the joint breaking).

    We have tried multiple approaches to this, we've setup the interaction system to successfully grab on to the handles, created joints between the hands and the handles, but everything just keeps going haywire.

    Pushin objects around is something that could be very useful but doesn't seem to be done anywhere and would be a great use of the IK systems, this would be useful for carts, wheelbarrows, etc. Any suggestions or direction you could offer?
     
  7. wherget

    wherget

    Joined:
    Oct 4, 2016
    Posts:
    4
    Hi Pärtel,

    I seem to be having a similar problem to the person in #1994, in that I can't seem to get a rig for a robot arm with a directional end effector set up correctly. It is my understanding that CCD+Aim IK is probably the solution I am looking for. Did you ever end up posting the additional code that was required there, because I can't seem to find it. :-(

    An Illustration of what I am trying to achieve: I have the robot arm as pictured (idle pose), and would like the "Screwdriver_head" oriented such that it points in the direction of the y axis of the (illustrative) pivot point. There will eventually be a matching screw there. Additionally, I would like to be able to specify the direction in which the "Adapter_plate" (the reddish bit in the picture) is oriented. I thought this possible with Aim IK by specifing the X axis as pole axis, am I right?
    RobotArm.png

    Can you maybe provide an short outline on how to set this up? Do I even need a CCD solver? From the examples I gather that there needn't be bones included in the solver all the way down to the effector, and that the Aim transform should probably be the "Screwdriver_head", right? What is the right stopping point for the IK chain?

    Sorry for being very new at this and not quite being able to ask the right questions.
    Thanks for your help!
     
  8. fsutton12

    fsutton12

    Joined:
    Oct 8, 2013
    Posts:
    1
    Hello,

    I'm totally new to Final IK.

    So I followed the tutorial "Final IK Tutorial - Setting Up VRIK for Steam VR". Seemed to work as described. My next step was to take what I learned in the video and apply that to a terrain that I generated. The terrain has hills and valleys. The issue that I am having is that the player is losing sync with the camera. If I walk up onto a hill, the feet start gradually going into the terrain and dragging. It's as if the player is staying on one plane and the camera is syncing fine with the terrain. The opposite is true of valleys. If I start to walk into a valley, the camera follows the terrain, but the player raises directly above the camera. The deeper the valley, the higher the camera goes. So it seems like x and z movement are fine, but Y is not. Do you have any suggestions as to what might be wrong?

    Thanks
     
    Last edited: Jul 6, 2017
  9. Catttdaddy

    Catttdaddy

    Joined:
    Mar 17, 2015
    Posts:
    55
    Hand poser activate by trigger
    I was wondering if anyone knew how I could start the hand poser by a trigger. I am using VRTK and would like to lerp into a hand position as you move your hand closer to an object then grab it (Transition into the holding pose) on button click. Any advice or assist would be appreciated.
    Thanks!
     
  10. fzyfzyfzy

    fzyfzyfzy

    Joined:
    Nov 14, 2015
    Posts:
    1
    Hi, does anyone use Final IK for full motion capture in VR?
    Recently I try to use HTC Vive and Final IK for full motion capture. There are 6 markers to track body pary in my project, 1 HMD for head, 2 controllers for hands, 3 Vive trackers for waist and foot.
    But the foot mesh seems non-normal. I think there should be a calibration process to calibrate my foot trackers offset before full motion capture.
    Does anyone have suggestion on solving these problems? Thx anyway XD.
     

    Attached Files:

  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi all, sorry for the delay once again, I've been in Switzerland to test out VRIK for full body tracking in an arcade-like environment. ;)

    Hey,
    So the character will lose contact with the cart when the distance to the hands is unreachable? Then You'll just need to keep the character in reach. How is the cart controlled, with physics? Or do you just parent it to the character?

    Hey,
    It can be done with some additional scripting. Please import this package, it has a couple of examples. Let me know if you have trouble setting it up on your particular rig.

    Hey,
    You'll just need to do some raycasting to keep the root of the character grounded, VRIK does not adjust the vertical position of the root. See the "VRIK (Grounder)" demo for foot placement stuff.

    Hey,
    You could have a trigger collider and when it detects the hand, start blending in handPoser.weight.

    Hey,
    I was in Geneva last week doing exactly that, setting up VRIK for 6 trackers.
    The foot (and all other) targets are dependent on bone orientations. IK will work to match the orientations of the bones to the target.
    What kind of calibration process are you using, stepping into the avatar? You could have footsteps that the player should step in to calibrate, then just create targets for the feet, match their pos/rot to the toe bones and parent them to the foot trackers at that point.
    I'll be making a calibration demo ASAP based on the experience I gained last week.

    Cheers,
    Pärtel
     
  12. caden-burleson

    caden-burleson

    Joined:
    Aug 1, 2011
    Posts:
    24
    So I just bought Final IK the other day and I can't get the Full Body Biped IK to show the wire-frame in the scene view. My character doesn't have any feet, so IDK if that has anything to do with it not showing up; Is there anyway to setup a custom character IK rig in Final IK?
     
  13. GloriaVictis

    GloriaVictis

    Joined:
    Sep 1, 2016
    Posts:
    133
    Hello,

    We are having some very random issue with leds to:

    Invalid IKEffector.positionOffset (contains NaN)! Please make sure not to set IKEffector.positionOffset to NaN values.
    Invalid IKEffector.positionOffset (contains NaN)! Please make sure not to set IKEffector.positionOffset to NaN values.
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object, Object)
    UnityEngine.Debug:LogError(Object, Object)
    RootMotion.FinalIK.IKEffector:OnPreSolve(IKSolverFullBody) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKEffector.cs:241)
    RootMotion.FinalIK.IKSolverFullBody:ReadPose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:235)
    RootMotion.FinalIK.IKSolverFullBodyBiped:ReadPose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBodyBiped.cs:509)
    RootMotion.FinalIK.IKSolverFullBody:OnUpdate() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:211)
    RootMotion.FinalIK.IKSolver:Update() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets\Plugins\RootMotion\FinalIK\IK Components\IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets\Plugins\RootMotion\Shared Scripts\SolverManager.cs:113)

    Look rotation viewing vector is zero
    UnityEngine.Quaternion:INTERNAL_CALL_LookRotation(Vector3&, Vector3&, Quaternion&)
    UnityEngine.Quaternion:LookRotation(Vector3, Vector3) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MathBindings.gen.cs:95)
    RootMotion.FinalIK.BoneMap:GetTargetRotation(IKSolverFullBody) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:287)
    RootMotion.FinalIK.BoneMap:RotateToPlane(IKSolverFullBody, Single) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:204)
    RootMotion.FinalIK.IKMappingLimb:WritePose(IKSolverFullBody, Boolean) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMappingLimb.cs:170)
    RootMotion.FinalIK.IKSolverFullBody:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:312)
    RootMotion.FinalIK.IKSolverFullBodyBiped:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBodyBiped.cs:576)
    RootMotion.FinalIK.IKSolverFullBody:OnUpdate() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:221)
    RootMotion.FinalIK.IKSolver:Update() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets\Plugins\RootMotion\FinalIK\IK Components\IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets\Plugins\RootMotion\Shared Scripts\SolverManager.cs:113)


    transform.position assign attempt for 'hip_R' is not valid. Input position is { NaN, NaN, NaN }.
    UnityEngine.Transform:INTERNAL_set_position(Vector3&)
    UnityEngine.Transform:set_position(Vector3) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\TransformBindings.gen.cs:27)
    RootMotion.FinalIK.BoneMap:FixToNode(IKSolverFullBody, Single, Node) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:178)
    RootMotion.FinalIK.IKMappingLimb:WritePose(IKSolverFullBody, Boolean) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMappingLimb.cs:166)
    RootMotion.FinalIK.IKSolverFullBody:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:312)
    RootMotion.FinalIK.IKSolverFullBodyBiped:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBodyBiped.cs:576)
    RootMotion.FinalIK.IKSolverFullBody:OnUpdate() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:221)
    RootMotion.FinalIK.IKSolver:Update() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets\Plugins\RootMotion\FinalIK\IK Components\IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets\Plugins\RootMotion\Shared Scripts\SolverManager.cs:113)

    Assertion failed on expression: 'fRoot >= Vector3f::epsilon'
    UnityEngine.Quaternion:INTERNAL_CALL_FromToRotation(Vector3&, Vector3&, Quaternion&)
    UnityEngine.Quaternion:FromToRotation(Vector3, Vector3) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MathBindings.gen.cs:84)
    RootMotion.FinalIK.BoneMap:Swing(Vector3, Vector3, Single) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:225)
    RootMotion.FinalIK.BoneMap:Swing(Vector3, Single) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:218)
    RootMotion.FinalIK.IKMappingLimb:WritePose(IKSolverFullBody, Boolean) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMappingLimb.cs:161)
    RootMotion.FinalIK.IKSolverFullBody:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:312)
    RootMotion.FinalIK.IKSolverFullBodyBiped:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBodyBiped.cs:576)
    RootMotion.FinalIK.IKSolverFullBody:OnUpdate() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:221)
    RootMotion.FinalIK.IKSolver:Update() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets\Plugins\RootMotion\FinalIK\IK Components\IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets\Plugins\RootMotion\Shared Scripts\SolverManager.cs:113)

    Assertion failed on expression: 'CompareApproximately (det, 1.0F, .005f)'
    UnityEngine.Quaternion:INTERNAL_CALL_FromToRotation(Vector3&, Vector3&, Quaternion&)
    UnityEngine.Quaternion:FromToRotation(Vector3, Vector3) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MathBindings.gen.cs:84)
    RootMotion.FinalIK.BoneMap:Swing(Vector3, Vector3, Single) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:225)
    RootMotion.FinalIK.BoneMap:Swing(Vector3, Single) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMapping.cs:218)
    RootMotion.FinalIK.IKMappingLimb:WritePose(IKSolverFullBody, Boolean) (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKMappingLimb.cs:161)
    RootMotion.FinalIK.IKSolverFullBody:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:312)
    RootMotion.FinalIK.IKSolverFullBodyBiped:WritePose() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBodyBiped.cs:576)
    RootMotion.FinalIK.IKSolverFullBody:OnUpdate() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolverFullBody.cs:221)
    RootMotion.FinalIK.IKSolver:Update() (at Assets\Plugins\RootMotion\FinalIK\IK Solvers\IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets\Plugins\RootMotion\FinalIK\IK Components\IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets\Plugins\RootMotion\Shared Scripts\SolverManager.cs:113)

    Is there a way we can fix a player when it happen already? It just shred player model and spam until he quit the game.

    We are using Grounder and LookAt only. The only thing I have edited was LookAt to be able to set and change targets dynamicly while moving character head smoothly:
    https://i.gyazo.com/555ce0ff24cd6b5c5a607240f78cec10.png
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Yes it requires for the rig to have legs, you could create virtual legs with new gameobjects or just use LimbIK if you only need some IK for the arms.

    Hey,
    Which FIK version are you using? Check version info from Plugins/RootMotion/FinalIK/FinalIK ReadMe.txt.
    Asking because a NaN error like this was fixed in the latest version (1.6.1). It was due to CapsuleCasting returning a NaN for hit.point in some occasions if cast against large colliders.

    Best,
    Pärtel
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi all!

    Made a new version of the VRIK LeapMotion integration for head mounted use. Should be extremely easy to use compared to the old method, but works only for Humanoids (only way to make it easy).

    Best,
    Pärtel
     
  16. dwaldrum

    dwaldrum

    Joined:
    Jun 20, 2015
    Posts:
    48
    We setup a simple cart (like a shopping cart) with wheel colliders. Then we used the interaction system so the player can grab on to the handle. Once they do we create joints betweem the hands and the handle but at this point everything goes haywire. What we would like is for the player to be able to walk and as they do. It pushes the cart. And if something pushes the cart away enough the joints will let go.
     
  17. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    We've been experiencing an issue with Biped Look IK, where the moment we enable Look IK at full weight, the character looks in a wrong direction, by a significant margin. The biped character has an animator component attached to it with a default idle animation that includes some head turns, some sniffles etc.

    After some digging, we found that the IKSolverLookAt was being initialised on the first frame, AFTER the animator had already applied the first frame of animation, so some of the LookAtBone axis values were wrong.

    We fixed this by modifying the SolverManager to initialise on Awake instead of on Start, and run before all other scripts in the execution order, so it would be guaranteed to initialise before any animators.

    However... does FinalIK assume that all biped characters are in their T-Pose on the first frame of execution so that all bones can be initialised correctly? If so, this should be CLEARLY documented!

    Perhaps BipedIK or FullBodyIK could provide the option to initialise skeleton data from a SkinnedMeshRenderer's bones or a Character Avatar?
     
  18. GloriaVictis

    GloriaVictis

    Joined:
    Sep 1, 2016
    Posts:
    133
    Right, my bad. I was sure its 1.6.1 but seems like I had to delete entire temporary files unity downloads just to be able to update it.
     
  19. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,756
    With the introduction of GameObjectRecorder in Unity 2017, is it now possible to create character animations with FinalIK in editor?
     
    hopeful likes this.
  20. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Well there is skele already.
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    You can't just attach joints to the hands of an animated character with IK and a rigidbody. Mind that IK is applied in LateUpdate, before that the hands are where they were animated to be so during the physics step, the cart will be pulled to wherever the hands are at that point. You could try connecting the cart to the character root with a joint and leave the hand connection part to just IK.

    Hey,
    That's strange IK components initialise in Start and normally there is no mecanim update before Start. What is the update mode of you Animator?

    Hey,
    Haven't had a chance yet to check out all the new features of Unity2017 also including the Timeline, but will certainly do so as soon as I get some more urgent developments sorted..

    Best,
    Pärtel
     
    AcidArrow likes this.
  22. Fabbs

    Fabbs

    Joined:
    Dec 2, 2013
    Posts:
    43
    Hi! i probbaly missed something simple in the documenation, but is there any easy way to keep the head from snapping to a new target when changing target in the look at solver?

    thanks :)
     
  23. jbooker410

    jbooker410

    Joined:
    Mar 9, 2014
    Posts:
    41
    Amazing asset! Could not be happier! The only issue I am Having is I am trying to integrate this with VR weapon interactor. VR Weapon interactor holds the weapon to the same controller that the VRIK is using to track. The only problem I am having is when I move the weapon the hand lags slightly behind. Is there a lurp somewhere I’m not seeing to adjust? I need it to track exact as if it were parented to the gun.
     
  24. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Hi Partel! Quick question pertaining to Puppetmaster's FIK integration:

    Is there a way to assist the puppet in recovering from the stagger behavior more easily? It seems to almost never balance itself, even in the demo, and with tweaks.

    Would I be better off just switching back from the stagger behavior myself after a short duration/velocity check?

    Also, are you still working on procedural animation stuff? It seems like it would be really worthwhile - especially for achieving immersive behavior for VR projects! Although procedural animation tools would probably be worthy of a separate asset entirely, I suppose.

    Thanks.
     
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Don't change the target, instead, make a script that interpolates the target smoothly between various positions:
    Code (CSharp):
    1. ik.solver.target.position = Vector3.SmoothDamp(ik.solver.target.position, whateverYouWantToLookAt, ref targetVelocity, smoothTime);
    Hey,
    Must be an issue with the update order of things. Maybe IK updates before your weapon interactor script so it lags a frame behind? Check the Script Execution Order. You can also disable the ik component and call ik.solver.Update() whenever you need.

    Hey,
    There is currently no way to recover from a stagger. You should only enable the stagger when the puppet has been pushed hopelessly out of balance in the first place. I've tried just blending pin weights back in after some staggering, but it will not look believable.
    About procedural animation stuff, of course I'm still doing R&D on that, will add VR demos to PuppetMaster as soon as possible. Here's a teaser ;)

    Best,
    Pärtel
     
    tapawafo likes this.
  26. staron82

    staron82

    Joined:
    May 22, 2017
    Posts:
    19
    Hey Partel,
    Loving your assets so far!

    Quick question I was hoping you could help with. We have an aiming animation made for specific weapon. However, we want to equip several different weapons where the second hand needs to be in different positions. What would be the best way to achieve this?
     
  27. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Thanks for the response! The teaser looks great - glad to hear you're still working on it! :)
     
  28. OmarRodriguez123

    OmarRodriguez123

    Joined:
    Jul 18, 2017
    Posts:
    4
    View attachment 239403

    How can I lock joints-If I choose for a joint not to translate-but only rotate- how can i tell ccdik to lock the translation--- I have been using the weights- but no luck yet.

    also if a joint is straight-like the chain above-i am trying to make the 3rd joint from the left go forward when the crank is pulled down-- how can i keep the link connected.-(i have it reading joints at the moment)the 3rd joint from the left is not rotating along- or around the 4rth joint-from the left.- when i bring down the crank. its staying stationary- this middle V piece- needs to maintain the same angle when i pull the crank-it .---and all should react down the line.-unfortunately brakes because the 3rd joint from the left is not pulled forward
    upload_2017-7-18_16-28-22.png
    upload_2017-7-18_16-28-44.png
     
  29. OmarRodriguez123

    OmarRodriguez123

    Joined:
    Jul 18, 2017
    Posts:
    4
    upload_2017-7-18_16-41-16.png -this is for the above post
     
  30. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    I've been plugging FinalIK/VRIK with UMA and SteamVR - I believe good standard use-case. Mostly works, few issues that needs to be resolved. I'm using Unity 2017.1 with up-to-date SteamVR.

    Great asset altogether, easy to set up - I'm just hoping some solid clarification how to solve the few issues below :)


    1. Hand/Head offsets angles and position - to match controller and headset position

    I've learned so far to use the following to get the positions somewhat right (all euler angle rotations x/y/z of cloned part before attaching to SteamVR's parent):

    Left hand: 0, -90, 100
    Right hand: 0, 90, 100
    Head: 0, 0, -90

    Position requirements (haven't found proper values yet):

    Hands:
    to match the grip on controller. I have SteamVR Player-prefab in use, that shows controller accurately, and the hand is quite clearly off. This same happens on FinalIK demo of VRIK for SteamVR, so it's reproducible easily.

    Head: Would be nice to get best-practice of how to get the headset outside the UMA model's head properly.

    2. Animations - on UMA

    Humanoid animations do work, so that the IK works, however no matter what I choose for the animation, the character changes position of its lower body. Like it wouldn't "fit" in its position, while the position is quite natural.

    Would be nice to have proper example of how to get UMA model to be relaxed IKed, like all those pretty YouTube demos.
     
  31. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    Just to add, it could also be something silly. I've so far only added VRIK component to the UMA. The documentation doesn't mention VRIK much at all, so I'm not sure if I should be adding also some additional solver to achieve foot/full body control of UMA.
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Sure, you'll just need to make a script that defines a Vector3 leftHandOffset for each weapon. Then, in LateUpdate, add positionOffset to the left hand in the rotation space of the right hand, that is holding the weapon:
    Code (CSharp):
    1. ik.solver.leftHandEffector.positionOffset += ik.references.rightHand.rotation * currentWeaponOffset;
    Using += there instead of = because the solver resets all positionOffsets to zero after each update to allow for multiple offset modifiers working on the effectors simultaneously.

    Hey, could you send me that rig as a unitypackage so I could take a closer look at it? Not sure I understand how that rig is supposed to work based on that drawing.

    Hey,
    The IK targets of VRIK (and all other IK components in FIK) work so that the solver will match the bone position/orientation to target positionb/orientation, so it all depends on the bone orientations of the avatar you are using. Since there are millions of avatars with all kinds of bone orientations, those localPosition/Rotation values need to be found empirically for each avatar definition like in this tutorial.

    About question no 2, not sure I understood, could you please make video of that "not fitting in it's position" or something? Perhaps the scale of the avatar is too small so the feet don't reach the ground?

    VRIK is still rapidly evolving, so I'll be making docs for that as soon as it "settles down" a bit. For now, information can be found from the tooltips of the solver parameters. There are targets for the pelvis and also the feet so you should not need to use any additional solvers for full body control.

    Cheers,
    Pärtel
     
  33. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Apologies! We've done some further testing and found that the issue is actually with ParadoxNotion's Slate plugin. Slate's custom animation code runs on Start, before FinalIK has had a chance to initialise. If the Slate Cutscene script is moved to the END of the Script Execution Order, the problem is fixed. Good to know.
     
  34. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    Here you go with the video. Note: The controllers lose tracking at bursts, but if you see the character is constantly changing its pose, while (especially when zoomed out later in the video) the head is accurately put and the hands also mostly follow the controllers.



    I tried to target the feet, but I think I missed/forgot the pelvis.

    Btw I didn't mean to sound negative on the documentation and additional solvers, completely understand the constant evolving making it impossible to document at the same time :) Great asset!
     
  35. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    Now playing around, I noticed that I hadn't given any weight on position/rotation on binding the feet as targets.

    However giving the weight of 1 on feet and pelvis resulted more "stable" pose, but it was twisted in a way that the feet were clearly pulling "max out" some direction.

    I suppose I just lack the guidance/idea on how to bind the other targets; the head and hands were obvious and solid examples for SteamVR positioning. I got the general idea that Final IK is smart enough to just pose the character with those :) It did find the UMA's skeleton quite accurately automatically.
     
  36. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    Ok I rewatched the tutorial now I had accidentially skipped to the end positioning first time when I followed it.

    Great example and seems to work with the body with just connecting the three parts, so there is something odd in my standard UMA asset (or its usage) causing the wobble then it seems...
     
  37. Kallex2

    Kallex2

    Joined:
    Dec 5, 2016
    Posts:
    14
    Hand inaccuracy in the video is explained by the fact, that my "static pose" that consists of headset on the shelf and controllers in front of it on the table makes the hands be "too far". The wobble however continues even when the controllers are brought to close enough and hands become solid.

    So then the head and hands are perfectly working with IK, but the rest of the body remains too loose.
     
  38. OmarRodriguez123

    OmarRodriguez123

    Joined:
    Jul 18, 2017
    Posts:
    4
    I included the prefab that contains all the ccidk rigged up----the long poles- are bolted to the wall---are where i want the object to hinge from.---I want to be able to pull the crank and be able to hinge all downstream. Attached is my unity package.
     

    Attached Files:

  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    I'm almost done with my calibration tool for VRIK and additional trackers, please check it out, perhaps using that will get rid of that weird wobble issue. No tutorial for that yet though, it's not finished, but see the tooltips for information on what the params in the calibration settings mean.

    Hey,
    CCD and FABRIK are not powerful enough to handle that kind of complexity, CCD does not support mid-effectors to keep some parts of the chain locked and neither support rigidbody links rotating around a pivot.

    I'd actually try to set a rig like that up with PhysX. Just create rigidbodies and joints for the rig and link the fixed parts to kinematic rigidbodies (rods), also link the end to a kinematic rigidbody that will become your controller.

    Best,
    Pärtel
     
  40. BernieRoehl

    BernieRoehl

    Joined:
    Jun 24, 2010
    Posts:
    80
    I'm having a problem with colliders on mecanim bones while using VRIK.

    Without VRIK, it works fine -- I put a collider on the index finger bone, and it correctly interacts with objects in the scene. However, when I use VRIK, the same collider on the same joint does not produce a collision.

    Not sure why that would be the case, or what to do about it.

    Any suggestions?
     
  41. OmarRodriguez123

    OmarRodriguez123

    Joined:
    Jul 18, 2017
    Posts:
    4
    Thanks Partel, we are going to end up using hinge joints and motors.to drive the whole thing---thanks for your help.
     
  42. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
    Hi again Partel,

    I'm trying to use the bend goals to move my VRIK character's elbows more toward the midline when doing a block (it's a fighting game). At first I parented the bend goals to the chest since I want them to always be in the same place relative to the torso but when run that makes the elbows bend *away* from the targets. I can only get them to work correctly if they are not parented to the character rig but I'd prefer not to do this since then I have to write code to keep them in the same position relative to the chest. Any idea what is happening?
     
  43. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    185
    With calibration tool for VRIK , im gettin this error 'Quatools.MatchRotation' could not be found?
     
  44. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Hi Guys,

    I have a very neat little High Heel Adjustment System. Follow the instruction to try it out.

    Add these to the root of your character game object

    1. Add Full Body Biped IK to your character
    2. Add Grounder FBBIK to your character
    3. Assign the Left Leg bone to the Full Body Biped IK Left Leg
    4. Assign the Right Leg bone to the Full Body Bipped IK Right Leg
    5. Add VGS_VLRHeelAdjuster to your character

    Note : The heel adjustment also does a ray cast to ensure that the foot height does not stub into gradients for both flat and high heel angles.

    Enjoy !


    Code (CSharp):
    1. using RootMotion.FinalIK;
    2. using UnityEngine;
    3.  
    4. public class VGS_VLRHeelAdjuster : MonoBehaviour
    5. {
    6.     public LayerMask layer;
    7.     public Transform root;
    8.     public Transform leftHeel;
    9.     public Transform rightHeel;
    10.    
    11.     public float minAngleHeightAdjust = 20f;
    12.     public float angleHeightOffset = 0f;
    13.     public float minAngleHeightOffset = 0.05f;
    14.  
    15.     public float angleRight = 0f;
    16.     public float angleLeft = 0f;
    17.     public float offsetLeft = 0f;
    18.     public float offsetRight = 0f;
    19.  
    20.    
    21.     private FullBodyBipedIK FBBIK;
    22.     private GrounderFBBIK GrounderFBBIK;
    23.  
    24.     private void Start()
    25.     {
    26.         FBBIK = GetComponent<FullBodyBipedIK>();
    27.         FBBIK.solver.OnPreUpdate += AdjustHeel;
    28.  
    29.         GrounderFBBIK = GetComponent<GrounderFBBIK>();
    30. }
    31.  
    32.     // Adjust heel before the update
    33.     void AdjustHeel()
    34.     {
    35.         RaycastHit hitInfo;
    36.  
    37.         //Debug.DrawRay(root.position, Vector3.down, Color.red, 1f);
    38.         if (Physics.Raycast(root.position, Vector3.down, out hitInfo, 2f, layer))
    39.             GrounderFBBIK.solver.heightOffset = Vector3.Angle(hitInfo.normal, Vector3.up) > minAngleHeightAdjust ? minAngleHeightOffset : angleHeightOffset;
    40.      
    41.         // Clamp the range
    42.         float leftAngleClamped = Mathf.Clamp(angleLeft, 0f, 60f);
    43.         float rightAngleClamped = Mathf.Clamp(angleRight, 0f, 60f);
    44.         float leftOffsetClamped = Mathf.Clamp(offsetLeft, 0f, 0.3f);
    45.         float rightOffsetClamped = Mathf.Clamp(offsetRight, 0f, 0.3f);
    46.  
    47.         // Adjust the heel angle      
    48.         leftHeel.eulerAngles = new Vector3(leftHeel.eulerAngles.x, leftHeel.eulerAngles.y, leftHeel.eulerAngles.z - angleLeft);
    49.         rightHeel.eulerAngles = new Vector3(rightHeel.eulerAngles.x, rightHeel.eulerAngles.y, rightHeel.eulerAngles.z - angleRight);
    50.  
    51.         // Adjust the IK solvers leg height
    52.         FBBIK.solver.leftFootEffector.positionWeight = leftOffsetClamped;
    53.         FBBIK.solver.rightFootEffector.positionWeight = rightOffsetClamped;
    54.     }
    55. }
     
    Partel-Lang and hopeful like this.
  45. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey, we have a problem with a twiching animation when the IK is enabled. Please see here.

     
  46. BernieRoehl

    BernieRoehl

    Joined:
    Jun 24, 2010
    Posts:
    80
    Say, does anyone know if Partel is on vacation? It's been a week since he last posted anything.
     
  47. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Probably, I emailed him the question above, no response
     
  48. eyier

    eyier

    Joined:
    Aug 29, 2016
    Posts:
    6
    Hi Partel-Lang,
    I'm going to use Final IK habitually!
    I want you to tell me following solution method.

    I attached FullBodyBipedIK on a human character right.
    I also added a cube for a left hand effector to the scene.
    So,If a cube was pulled, a hand of a human character was pulled, and it was possible to tilt posture of a human character.
    The above is no problem.
    But,There is hair for a human character, hair doesn't seem to react to the inclination of the form of that case's human character.
    Hair is controlled by "bullet Physics".
    So,Hair reacts to movement of the character and an action of a AnimationClip.
    How should it be done to make hair react by Final IK?
    Please tell me.

    thank you,
     
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    I just tried adding a collider and a kinematic rigidbody to the hand of the Pilot in the "VRIK (Basic)" demo scene. Then added a non-kinematic cube to the scene and was able to push that cube around by moving the hand ik anchor. Could you try this? What did you do differently?

    Hey,
    I have not tried ICE myself, but basically FIK components work by just reading the pose of the character, solving according to their paramaters and writing the results back on the pose. You can disable the IK components and update them whenever you need by calling ik.solver.Update so by that achitecture it should work with just about anything.

    Hey,
    The position/rotation of the chest is changing in the solving process. That will not however translate the bend goal parented to the chest, as it's position has already been read when the solver reads the pose of the character before updating. The only way to make the bend direction depend on the chest would be to hack into IKSolverVRArm.cs's private Vector3 GetBendNormal and set bendDirection to something relative to chestRotation.

    Sorry, forgot to add the new QuaTools.cs.

    Hey,

    Does it happen with a different running animation?
    Sometimes there is a twitch in a locomotion animation, a sudden twist in the roll animation of the thigh bone, that is hardly noticable, but becomes exaggerated when IK bends the knee, because bending direction is defined by the roll of the thigh.

    Hey,
    Must be the update order of things. That hair physics must be updating before FIK, hence ignoring it's modifications to the character. You could disable the IK component in Start and call ik.solver.Udpate from a script that runs after the physics (use the Script Execution Order). FIK components normally update in LateUpdate.

    Hey,
    Yes, sorry about that, but the summer is incredibly short here in Estonia.
    Anyway, back now and starting to clear up the pile of support requests.

    Best,
    Pärtel
     
  50. fup

    fup

    Joined:
    Jan 18, 2016
    Posts:
    76
    Hey Partel,

    Thanks for the answer above. I have another question... Is it possible to prevent the VRIK solver from bending the elbow? If so how?

    Cheers