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. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    @Partel-Lang I didn't have a chance to figure out the jittering, cause I noticed this happening randomly. I changed the model, but copied all the configurations, so I don't understand why it's floating above the ground. It's fine while I'm sitting, but it's floating when I stand. https://imgur.com/a/jApHhm6 Also, I don't know whether it's related, and I can't replicate it, but on my testers's computer, he falls through the floor on a scene change. I don't change anything in the body's configuration, but in the Main Menu, it's fine, but in any other scene, he falls through the floor. This does not happen for me.
     
  2. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    158
    Sorry one last question, does it matter which gameobject gets this script?
     
  3. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    @Partel-Lang Hi, I've been using VRIK and it works amazingly! But I am having trouble with the hand targets when holding a gun with two hands.

    Right now I am parenting the gun to the right hand bone of my character (driven by the VRIK right hand target), and then setting the VRIK left hand target's position to the gun's handguard.

    My code looks something like this:

    Code (CSharp):
    1.         private void Start()
    2.         {
    3.             VRIK.enabled = false;
    4.             Gun.transform.parent = RightHandBoneTransform;
    5.         }
    6.  
    7.         private void LateUpdate()
    8.         {
    9.             VRIKLeftHandTarget.target.position = Gun.Handguard.position;
    10.          
    11.             VRIK.solver.Update();
    12.         }
    13.  
    But the left hand begins to lag behind the gun when the character moves, as shown in this video:
    https://drive.google.com/open?id=1r98muTDsbnXg3vkJ8nO58Ee0rA2j15es

    Is there a better way to set the position of the VRIK left hand target, so that it does not lag behind? Is it lagging behind because the actual gun is parented to my character's right hand bone, so the gun's handguard position is out of date until VRIK.Solver.Update() is called? Just to be check, I did try calling VRIK.Solver.Update() before AND after the left hand target position was set, but I still have the lagging issue.

    The movement of the character is done in Update(), and I am simply moving the parent transform of the right hand target, left hand target and head targets.

    Any suggestions? Thanks!
     
  4. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Hey @Partel-Lang, I have a problem where the player falls through the floor. It seems to happen whenever the controllers or headset aren't "awake" when the game loads. How can I make that not effect the VRIK body?
     
  5. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    If the feet float, it might be that the avatar is just too short for you. If it only happens when you look down, please try reducing the values of "Neck Stiffness" and "Body Rot Stiffness" in VRIK Spine settings.

    About the jitters, could be the controllers updated after VRIK updates. If you are using SteamVR plugin, find the "SteamVR Settings" scriptableobject in the project, set "Input Update Mode" to OnUpdate and "Pose Update Mode" to OnLateUpdate. If they use OnPreCull, then your controllers are updated after VRIK to reduce latency, but then you'll see the hands jitter relative to the controller mesh.

    If you use TrackedPoseDrivers, set their "Update Type" to "Update".

    No, it does not matter.

    Hey,
    How and when exactly are you moving the parent transform of the right hand target?

    Try moving the code that handles the right hand target to the same place where you set left hand target to make sure they are in sync.

    Hey,
    VRIK never moves the root of the character vertically, so it must be something else making it fall, probably a physics issue. Not sure without seeing the project.

    Cheers,
    Pärtel
     
  6. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    @Partel-Lang I hate to keep pinging you, but I'm not too good at adapting to new assets. I'm trying to use VRIK with Photon PUN. For some reason, even tho I have a Photon Transform View component on both characters, only client A (i don't know the order, just labeling for clarity) sees the client B moving. Client B doesn't see Client A moving.
     
  7. erw29

    erw29

    Joined:
    Sep 27, 2018
    Posts:
    13
    Hi Pärtl,

    I do have two questions regarding your current IK package:
    1. Is it recommended to use the TwistRelaxer only when there is a twist/roll bone between the wrist and elbow? I could not find a configuration which relaxes my wrist twist, it just moves the twist problem to a different bone (elbow or even shoulder, depending where I apply the twist relaxer).

    2. Is there a way to run a body part IK on the head similar to LegIK and ArmIK to adjust only the head position (and of course the related chain)? I would like to use this to perform a end effector adaptions when the head need to be in a particular position after applying a body pose retargeting.
    Best,

    Erik
     
  8. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Also, Partel, I was wondering how I would go about making a two-handed grip on a gun in VR? What parents to what, etc? Also, does Final IK have something that will help with finger positioning? I plan on having the gun held the entire time, so I don't need to worry about dropping, picking up etc. I do plan on having weapon switch-outs tho. So I either need two different hand poses, or I can figure out how to make do without precise finger placement.
     
  9. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hi, can you post the code that you're using and maybe pictures of your setup? I'm currently studying that, so I might be able to help, and if I can't, Partel will be able to help better if he has more details.

    Maybe Final IK has an option for that, but I believe Spring Joint or Fixed Joint might work pretty well for that and super easy to setup.


    Gabriel.
     
  10. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Can you expand please?
     
  11. ml785

    ml785

    Joined:
    Dec 20, 2018
    Posts:
    119
    Hi,
    Do you have examples of Dogs and other animal quadrupeds being animated with IK? I'd like to be able to, in Scene View, use the Move tool on them and see them move their legs to adjust. This can be done with the CCDIK mechspider, but I don't see Quadruped examples for this.
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,l
    PhotonTransformView only syncs the Transform that it is attached to, it doesn't sync the entire pose of the character.
    Normally you would sync VRIK like this:

    Owner:
    normal VRIK setup with head and hand IK targets parented to the camera and hand controllers.

    Remote:
    the same VRIK setup but IK targets parented to the root of the character instead. Position and rotation of those IK targets should be synced from owner to remote instances via OnPhotonSerializeView().
    If using VRIK's built-in procedural locomotion, it will follow the synced head target position the same way as it does on the owner.
    If using animated locomotion sync position/rotation of the root with OnPhotonSerializeView() and sync animation too.
    I would not use PhotonTransformView for the root as those network packages might arrive at different times/frequencies and you'd see head/hands jittering or out of sync with the position of the root and when you teleport, you might see the character's root at before teleport position and head/hands reaching to the new position for a few frames. That's why it is important to have all synchronization done with OnPhotonSerializeView().

    Hey,
    1. No, it doesn't have to be on the roll bone, but you can have multiple TwistRelaxers on that arm to even out the twist angles some more. Please import this package, I have restructured TwistRelaxer for the next version to support that.
    You can now add multiple solvers to one TwistRelaxer, add them in inverse hierarchical order - children first.

    2. Maybe this package helps? It is a script called HeadStabilizer, I made it for full body FPS to stabilize the head moving too much because of animation, but might help you with what you need to do too.

    Hey,
    There is HandPoser (add it to the hand bone), that can match the fingers to an identical posed hierarchy. So make a duplicate of the character, pose the duplicate's fingers to the gun, delete the rest of the duplicate hierarchy from hand-up. Assign the posed hand as "Pose Root" in HandPoser. There is also GenericPoser if the hierarchies are not identical in child numbers (right-click on it's header and do "Auto-Mapping" if you have Pose Root assigned.
    It is not a very easy thing to work with though, I am still developing a proper solution for the hands and fingers (UniversalHandPose).

    Of course you could also use animation. You can add Animators to the hand bones, use Animation Window to create pose animations for the hand hierarchies. It will run on top of your normal animation.

    For a 2-handed weapon, you'd need to pose hand targets and HandPosers for both left and right hands.
    Parent the posed hand hierarchies to the weapon. Parent the weapon to right hand controller, then assign the posed hands as IK targets and Pose Roots in the HandPoser/GenericPoser.

    Hey,
    I don't have examples of them being animated fully by IK, sorry, but there is a GrounderQuadruped example in the "Grounder" demo, if you switch to the Wolf. That is just foot placement correction.

    Cheers,
    Pärtel
     
    ml785 likes this.
  13. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Can you perhaps point me towards some documentation or code? I'm pretty new to Photon.
     
  14. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    How do I "assign the posed hands as IK targets"?
     
  15. rmon222

    rmon222

    Joined:
    Oct 24, 2018
    Posts:
    77

    Attached Files:

    Last edited: May 21, 2020
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Made this demo package for you, it is a VRIK Photon networking demo. Import PUN and Oculus Integration first.
    NetworkManager.cs just instantiates the player prefab, VRIK_Pun_Player.cs does all the syncing, read the comments and tooltips for more information. NetworkTransform is a snapshot of Transform.position, rotation, velocity and angular velocity, used for syncing IK targets. NetworkTransform data is the only thing synced over the net, it also takes care of interpolation for you.

    Just assign the posed hand Transform as IK target in VRIK arm settings.

    Hey,
    Is that with the built-in procedural locomotion? It doesn't handle moving from A-B very well, it was designed in the early days of VR when there was no room-scale yet. I'd switch for animated locomotion.
    But you could try slightly increasing the "Max Velocity" and "Velocity Factor" in Locomotion settings.

    Cheers,
    Pärtel
     
  17. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Thanks so much! I am so happy I decided to buy this asset!
     
    Partel-Lang likes this.
  18. rmon222

    rmon222

    Joined:
    Oct 24, 2018
    Posts:
    77
    Does FINAL IK have an animated locomotion example? Or is it up to us to add the leg animations? Thanks.
     
  19. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    The package was meant for Photon 1 I think, but I converted it to Photon 2 pretty easily.
     
  20. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    hi
    i tried to use interaction sitting in a Bench and worked well, but i have a question. Can use an animation for upper body? I try, but how the position is predefined the upper body don't move

    thanks
     

    Attached Files:

  21. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117

    Hey there,

    For the wrist twisting, it will never be perfect if the the character model doesn't have a bone that rotates the lower arm.

    In this asset pack, the author made sure to put a bone between the lower arms and hands and it works perfectly with twist relaxer:
    https://assetstore.unity.com/packages/3d/characters/humanoids/pbr-fighters-pack-145995

    So if you're gonna use VRIK for a game, make sure the model has that extra bone between the lower arms and hands.



    Gabriel.
     
    Partel-Lang likes this.
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    All I have right now is this demo. Would work better with better animations.

    Hey,
    The upper body seems locked because the hands and shoulders are used in interaction too, so they will be pinned to the bench by the IK. You should change the InteractionTrigger under Bench/Trigger to this:
    BenchTrigger.JPG

    ...to start the interaction without any upper body effectors.

    Best,
    Pärtel
     
  23. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    It seems that with this package, my character controller goes much slower. Do you have any idea why? Besides that, it works perfectly (after I switched it to PUN 2)
     
  24. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Don't i put the controller target there? How do I put two targets?
     
  25. erw29

    erw29

    Joined:
    Sep 27, 2018
    Posts:
    13
    Hi Pärtel,

    1. Are we talking about something like this?

      Code (CSharp):
      1.             TwistSolver handTwistSolver = new TwistSolver();
      2.             handTwistSolver.transform = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftHand);
      3.             handTwistSolver.parent = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftLowerArm);
      4.             Transform[] handChildTransforms =
      5.             {
      6.                 _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftThumbProximal), _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftIndexProximal),
      7.                 _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftMiddleProximal), _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftRingProximal),
      8.                 _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftLittleProximal)
      9.             };
      10.             handTwistSolver.children = handChildTransforms;
      11.  
      12.             TwistSolver elbowTwistSolver = new TwistSolver();
      13.             elbowTwistSolver.transform = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftLowerArm);
      14.             elbowTwistSolver.parent = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftUpperArm);
      15.             Transform[] elbowChildTransforms = {_targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftHand)};
      16.             elbowTwistSolver.children = elbowChildTransforms;
      17.  
      18.             TwistSolver shoulderTwistSolver = new TwistSolver();
      19.             shoulderTwistSolver.transform = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftUpperArm);
      20.             shoulderTwistSolver.parent = _targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftShoulder);
      21.             Transform[] shoulderChildTransforms = {_targetAvatarAnimator.GetBoneTransform(HumanBodyBones.LeftLowerArm)};
      22.             shoulderTwistSolver.children = shoulderChildTransforms;
      23.  
      24.             _leftArmTwistRelaxer = _targetAvatar.AddComponent<TwistRelaxer>();
      25.             _leftArmTwistRelaxer.ik = _leftArmIk;
      26.  
      27.             TwistSolver[] twistSolvers = {handTwistSolver, elbowTwistSolver, shoulderTwistSolver};
      28.             _leftArmTwistRelaxer.twistSolvers = twistSolvers;
      29.  
      30.             _rightArmTwistRelaxer = _targetAvatar.AddComponent<TwistRelaxer>();

      It still solves the problem only partially but might be that the problem is just not solvable with this approach and it's a skinning issue. But is the order correct?


    2. Thanks! That solves the Problem!
     
  26. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    since using root motion on my ai the final ik quad grounder is not working with my ai any ideas?
     
  27. jasonofthestorm

    jasonofthestorm

    Joined:
    Aug 22, 2017
    Posts:
    4
    Hi Partel! I'm stuck trying to tune a couple features.

    One is the mech spider in the CCDIK example scene. The velocity estimation does not appear to do anything. I'm using the velocity estimation in VRIK and it works pretty well, so I was hoping the spider example would have the same feature to help keep non-humanoid leg movements from dragging behind the body at high speeds. I haven't had any success with it, other than some odd floating behavior occurring at much higher values.

    My next issue is with VRIK locomotion causing head bobbing. I would like to increase the height that each foot reaches in each step for a character. I assume this is the "Step Height" setting under each leg in the VRIK component which achieves this, but it also makes my entire character bob up and down. This also disconnects the head from the HMD position (the hands remain locked to the controllers however). Is there a way to increase step height without affecting any upper body parts at all? I've tried using all of the positional weight settings, locking the pelvis, removing references but it still moves with each step.
     
  28. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    158
    Hey so maybe im misunderstanding something, but VRIK has completely stopped working for me. I have no idea whats supposed to go in the Root now, it was working fine originally but now anytime i add something to the root, it either cant be moved or it just starts walking off sideways forever. Tried reimporting, but i just cant get it to work.

    Is there a way to stop my root from getting all messed up? Like it wont let the root object move, it just warps it back to starting position.
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey, sorry for the wait!

    Not sure, what kind of a character controller are you using? Maybe it is the interpolation, try to increase NetworkTransform interpolation speed.

    Hey,
    This is how I would do it:
    1. Have VRIK hand target parented to the hand controller.
    2. Pose and parent hand hierarchy to the weapon.
    3. If grabbing the weapon (like when Touch controller grab trigger down), use LateUpdate to tween the IK target to the position and rotation of the hand that is parented to the weapon. So the VRIK target would still be parented to the controller, but it's position/rotation locked to the hand pose.
    4. When you let go, tween the VRIK hand target back to it's default localPosition/localRotation so it would be free to move with the controller again.

    Hey,
    Yes, but you don't need to normally set twistsolver parent and children, they will be found by TwistSolver when it initiates. You only need to assign children when the hand is not parented to the roll bone. Some rigs have this kind of hiearchy:

    - forearm
    - forearm roll bone
    - hand

    Then if you added TwistRelaxer to forearm roll bone, you would have to manually assign the hand into it's "children".
    If you had twistrelaxer on forearm, you'd have to assign both roll bone and hand as children.
    But it you have this:

    - forearm
    - forearm roll bone
    - hand

    Then you can leave them empty as TwistRelaxer can find them easily.

    Hey,
    Could you be more specific please, is it just not doing anything or is it doing something wrong? Can you make a video or something I could take a closer look at?

    Hey,

    About the spider, please import this update. Then, when you make it faster, also will have to reduce "Min Delay" for the feet and "Step Speed". For example if I set Speed to 20 in MechSpiderController, then I would set Min Delay to 0.02, step speed to 10 and velocity prediction to 0.2. It will take some tweaking of those variables, MechSpider is just an example script to demonstrate the IK, wasn't really designed for rigging up all kinds of spiders.

    About VRIK, please grab this patch. You'll get a "Max Body Y Offset" variable in VRIK locomotion settings. If you set it to 0, you'll get 0 head bob.

    Hey,
    What did you mean by adding something to the root? Sure you don't have your IK targets parented to the character hierarchy? That would cause circular dependency like the IK following the IK targets and locomotion then moving the IK targets further away again.

    Cheers,
    Pärtel
     
  30. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    158

    I mean in the References, where i put the bone hierarchy- the top one, Root, depending on whats there it wont let the master object move. Like it will actively resists any force being applied
     
  31. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    What do you mean "tween"? I also don't plan on having grabbing. The player will have the weapon the whole time. The problem is that the walking animations move the hands for some reason, even with an animation mask. Any idea how to fix that?
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    It must be the locomotion that is working on the Root. If you set Weight to 0 in VRIK's Locomotion settings, that should make it able to move. But then of course you'd have no procedural locomotion.
    If you are trying to move the character by something like thumbstick input and need locomotion to follow, You should move the VR tracking space instead, in case using Oculus, move the OVRCameraRig object. As head target is parented to that, the avatar will move along with the locomotion. Keep the avatar not parented to the camera rig.

    By tween I mean interpolating smoothly from one position/rotation to another with Vector3.Lerp() or SmoothDamp().
    Do the walking animations move the hands or just change the bending direction of the elbows. If you have hand position/rotation weight set to 1, animation should not move the hands. Can you record a video or something please so I could better understand what is going on there?

    Best,
    Pärtel
     
  33. applicattura

    applicattura

    Joined:
    Mar 28, 2017
    Posts:
    16
    Hello Partel,
    I have a humanoid character with some punching animations. I would like the character to face the enemy and always punch enemy's head. Is it possible to achieve it with final ik + puppetmaster for funnier effect?
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Yes, please check out these demos: "Aim Swing", "Aim Boxing" using AimIK, "Boxing" (more accurate, but slower as it requires FBBIK too).

    Best,
    Pärtel
     
  35. SSSekhon

    SSSekhon

    Joined:
    Jun 3, 2016
    Posts:
    11
    Hey Partel,

    Not sure if this has been answered before so will ask here and hopefully you can help.

    How do I limit the distance a hand can follow an ik target. I dont want my character to overreach and have him pulled in the direction of the target.

    I ask because my punch animations should maintain there original punch distance(or minimal if close to target). I have a clunky fix but it requires manually editing the distance for every punch on every character of different shapes and sizes.


    Ps I have played around with push, pull, reach but it still drags my characters spine forwards to attempt to reach the target.

    Any help is always appreciated. Thanks.
     
  36. tortillaguy

    tortillaguy

    Joined:
    Sep 26, 2013
    Posts:
    4
    Hi Partel,

    I have both FinalIK and PuppetMaster and I love the way they just work. I'm currently using them in a multiple character situation, and I notice they're eating away on the CPU performance quite a bit.

    Is there any chance you'd consider updating FinalIK to make use of the job system and also the burst compiler features of Unity? I think this could have the potential to increase the performance in order of magnitudes for FinalIK.

    I believe it would unlock the possibility of using FinalIK performantly with whole crowds of mecanim characters.
     
  37. kuchunwelhtc

    kuchunwelhtc

    Joined:
    May 1, 2020
    Posts:
    1
    First,thank you very much for the finalik hard work @Partel-Lang
    I take about one month to learn Blender and unity

    I just got a project working a full body tracking with 8 vive tracker's
    But I'm a little stuck here.. first i don't know how to script the calibration seat
    (The head bone in avatar it's around the nose, but the tracker it's on my Forehead)

    I already set avatar and my height both around 187 centimetre

    First I can't find any Tutorial about the calibration,
    just some script and " vrik calibration controller " in the finalik project
    your webside said has a DEMO about the vrik calibration, but i can't find it...

    1. Can you give me an instruction or a full Tutorial how to use the " vrik calibration controller "

    I'm also has some problem about the camra rig (From steamvr package)
    the left/right eye can't not see in the camra rig (I think because I use PIMAX headset)
    This does not affect me, but alot explanation in the Finalik said use the HDW for the head
    A little confused me..

    2. My questions is put tracker will affect the results?


    My hand wrist look weird when i straighten my arm
    is it Because I use the valve index controllers?
    3. How to fix this problem


    My Hardware:
    Pimax 8K plus HDW (I don't use for the tracking)
    8 tracker's (head、pelvis、2feet、2knee、2elbow)
    valve index knuckles (2 hands)
     
  38. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
    Hi, Pärtel, I think this question is not directly related to FinalIK, but I am wondering if you can give me some guidance. How can I blend between the IK result and a pre-made animation?

    For example, I am doing a 10-second live mocap performance, for the first 5 seconds, I want to use the IK result, and for the later 5 seconds, I want to play back a dance animation, how can I blend between these two parts?

    Thank you as always!
     
  39. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    557
    Hey @Partel-Lang,

    Did you discontinue your root-motion.com/qa/ pages, or are they just down? You answered a question of mine there prevously and I need to refresh my memory :) (Specifically, this was RE: how to rotate the pelvis bone on an FBBIK.)

    Thanks!
     
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    You could just limit the position of the IK target from the shoulder:

    Code (CSharp):
    1. ik.solver.leftHandEffector.position = ik.references.leftUpperArm.position + Vector3.ClampMagnitude(leftHandTargetPos - ik.references.leftUpperArm.position, armLength);
    If you don't want upper body to be pulled by the hands at all, set solver iterations to 0. That will disable full body solving and make it work basically like BipedIK + save you a bunch of CPU time.

    Hey,

    Animation and especially IK are terrible candidates for multi-threading by nature because they need to work on hierarchical data structures and be solved in specific linear order. I have made multiple test cases - AimIKJ and CCDIKJ solvers based on Animation Jobs (can import them from Plugins/RootMotion/FinalIK/_Integration), also the same using Animation Rigging framework, but they are all much slower than their old single-threaded counterparts, even if used on 100 or more characters. DOTS animation is going to be faster, but most likely not nearly as much as you've seen in some of the DOTS tech demos that are about moving tens of thousands of independent objects.

    Hey,
    I don't have a tutorial for calibration because there are a million different rigs people might have. So people use vive trackers for only the feet, some also have body and/or elbow trackers, some use VR hand controllers, others use trackers there too. Sometimes people use other kinds of motion capture systems and there are many different kinds out there.

    But basically this is what you should do:
    1. Make a new script like MyCalibration.cs
    2. Copy the code from VRIKCalibrationController
    3. Assign all the trackers/controllers as Head/Body/Hand/Foot Tracker in that component.
    4. Fill in the Settings in the editor, make sure all the forward and up axes correspond to the orientations of your trackers. Make sure the axes point in the same direction as they do on the green tracker mock objects in the demo
    5. Change if (Input.GetKeyDown(KeyCode.C)) to whatever input you wish to use to call for the calibration in you application.

    If your wrist looks weird, please try adding the TwistRelaxer component to the forearm or the forearm roll bones if you avatar has them. It runs after IK to even out the twist angle of the bone.

    I'm sorry I didn't understand the question about the "he left/right eye can't not see in the camra rig". Did you mean you can't see anything when you put on the headset?
    About the information to use HMD as VRIK head target, it means you should make a duplicate of the avatar's head bone, assign it as VRIK head target and parent it to whatever represents the head tracker. With Oculus that would be the CenterEyeAnchor, with OpenVR that would be the Camera under the [CameraRig].

    Hey,
    You can do that just by smoothly blending ik.solver.IKPositionWeight to 0. Then you'll be free to play the dance animation. You can have the animator enabled at all times, just when using IK, use a subtle idle animation so it wouldn't mess with the IK too much. Can use Baker to bake a short animation clip of just the default pose too.

    Hey,
    Yeah, sorry, had to nuke that because of all the automated spam, notification and other issues. The new helpdesk can be found here. Unfortunately I was not able to migrate all the content.

    About rotating the pelvis with FBBIK, please check out the "Offset Effector" demo and try rotating the "Pelvis Effector" there.

    Cheers,
    Pärtel
     
  41. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    557
    Ah, I see. Dang, that stinks! Just going through them has helped me out a bunch of times.

    Thanks, that mostly works! I am curious how this works though, since it's only setting the positionOffset (no rotation). I'd like to keep the effector operating in world space, but changing the relevant line to
    effector.positionOffset = (transform.position - effector.bone.position) * weight * e.weightMultiplier;
    breaks the rotation working (as expected); same if I set the body weight inside the FBBIK to 1.

    Any ideas @Partel-Lang?
     
  42. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
    That's too great, Pärtel, thank you!
     
  43. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    https://imgur.com/a/lB1w2DU
     
  44. alex-teodor

    alex-teodor

    Joined:
    May 8, 2014
    Posts:
    4
    Hello!

    I am having some problems implementing VRIK and Photon for a multiplayer application.
    I am using VRIK just for the head and hands movement. For the legs, I have a walking animation.
    Did someone manage to implement this? What game objects should I sync over the network?
    The game objects set as targets set for VRIK or the transforms of the body?

    Thanks
     
  45. 11nova

    11nova

    Joined:
    Sep 9, 2015
    Posts:
    14
    I've been playing around with VRIK for a couple days now and I am trying to get the legs to look decent when moving my character. The legs tend to stretch like crazy like in the image I uploaded. Anyone experience anything like this? What did you do to get the legs to step more accurately?

    Thanks in advance :)
     

    Attached Files:

    • Legs.png
      Legs.png
      File size:
      45.7 KB
      Views:
      342
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    OffsetEffector basically just rotates thigh effector positions around itself so that's how it looks like it is rotating the pelvis.

    You should use positionOffset += instead of = in your code when working with positionOffsets. They will be reset to zero after each solver update, so don't worry about that adding up over the frames. It was designed like that so multiple positionOffset modifiers could be applied on top of each other.
    You should also account for other modifiers so change the line to this:

    Code (CSharp):
    1. effector.positionOffset += (transform.position - (effector.bone.position + effector.positionOffset)) * weight * e.weightMultiplier
    Hey,
    Do you have HandPosers on those hands? If you have "Pose Root" assigned that would keep the fingers locked to the assigned pose. Set handPoser.poseRoot to null to disable that. The hand will be free to be animated again then.

    Hey,
    Just made a VRIK-PUN integration demo recently, check it out please. Basically it syncs just head and hand targets, IK is solved locally on each machine.

    Hey,
    What kind of settings you use for locomotion, the default ones?
    You might want to check out this demo about using animation for locomotion. Animation works better for moving from A-B.

    Cheers,
    Pärtel
     
  47. alex-teodor

    alex-teodor

    Joined:
    May 8, 2014
    Posts:
    4
    Just found the package
    Hello,

    Just today I saw the integration package you made and now I was checking it out!
    Thanks a lot for this, I will use it as a reference!
     
  48. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    I have nothing on the hands.I have an avatar mask that masks out the hands, and it causes that for some reason.
     
  49. alex-teodor

    alex-teodor

    Joined:
    May 8, 2014
    Posts:
    4
    Hi again,

    So I managed to implement the VRIK - Photon package you made, the syncing is behaving properly except for the fact that it takes the same movement of the vr controllers for both instantiated prefabs, so both have the same movement of the hands, no matter if I control the local prefab or the remote prefab. Any ideas of how I can fix this? Thanks
     
  50. alex-teodor

    alex-teodor

    Joined:
    May 8, 2014
    Posts:
    4
    I am giving my own reply, but I managed to fix this issue :)
    Thanks again for this great Unity package! :)
     
    Partel-Lang likes this.