cancel
Showing results for 
Search instead for 
Did you mean: 

transfer Hand tracking skeleton to custom Hand rig

Quacklin
Protege
I would like to map the hand tracking bones to my custom avatar with arm IK. But the hand bones from the hand tracking sample framework are generated on runtime and until I cant test it in the editor I don't know how to re-target the hand transformation data.

9 REPLIES 9

RJdoesVR
Protege
It's a little bit of extra work, but the fbx file for the hands they use are in the Mobile SDK. It's in the samples for it

Quacklin
Protege
Got it.
But when searching for the bones or marker by name unity doesn't find anything on runtime  😞
ny9bl4qd5ngf.png

alex_chesser
Explorer
Hey Quacklin, looks like we're trying to crack the same nut here... have you made any progress since this post?  I was hoping to get a bit of time this weekend to dig a little deeper. Would love to have an update on where you ended up eventually.

Tweed_Machine
Honored Guest
i've got an issue referencing the bones for the left hand. There is a list of the "boneID" in the OVRSkeleton.cs it states it in the code. just find that bone name on runtime Gameobject.Find("Hand_Index1").transform.position; but this doesn't help me as it works for Right Hand only.

alex_chesser
Explorer
Oh my gosh! I forgot this one.  I should probably let ya'll know I solved this a day later.

there's a video here (my account doesn't have permission to post links right now so you've got to add the dots yourself)

www-youtube-com/watch?v=9JyPDfKhzzE

There's still an outstanding issue with the thumbs, but that's pretty minor.

@Tweed_Machine - you'll find that using a cached reference to the object is a lot faster and more reliable that gameobject.find.

Something like: 

// drag this from the editor view or assign via GetComponent in AWAKE or START
[SerializeField] OVRSkeleton LeftHandSkeleton;

[...]

// later in your code.
Transform LeftHand_Thumb1 = LeftHandSkeleton.Bones[(int)OVRSkeleton.BoneId.Hand_Thumb1].Transform

 

madhawap
Explorer
@"alex.chesser" I tried running your GitHub project in here `https: // github.com/AlexChesser/VR_ARMS_DEMO` but finger tracking is not working for me 😞 Hands move with controllers otherwise don't even move. See the image attached.  I am using Unity version 2019.3.15f1 Any advice on why I am getting this? Thank youa467prfkcq8w.jpg

alex_chesser
Explorer
@madhawap hey! Sorry - I haven't touched any of this since about the time that COVID really kicked off.  

I'm not sure why hand/finger tracking might have stopped working between then and now.

Remembering that facebook's motto at one time was "move fast and break stuff" it might be the case that they've updated the APIs on the oculus device. This was originally written using a beta/preview of hand tracking so if they're up to 1.0 maybe they changed the names of the "endpoints" or moved the namespaces around.

Take a look for example at the hand tracking finger map: github.com/AlexChesser/VR_ARMS_DEMO/blob/master/Assets/Scripts/HandTrackingFingerMap.cs 

If they renamed Hand_Pinky3 to Pinky3 or Oculus_Pinky3 we woulnd't be able to hook into the movement event that got published by the finger tracking API anymore.

End of the day though - sorry - no idea what's happened.  I promise it was super cool at the time :smiley:

madhawap
Explorer
Hey "alex.chesser", thanks. Yes, definitely, it must have been super cool. I enjoyed your YouTube video. 

I checked the endpoints and namespaces after seeing your message. If I haven't missed any, they seem alright. 

I am just curious to see that your FingerIK.cs is not applied to any gameobjects or haven't referenced. I added a Debug.Log() to see whether the script is called at the start but it is not. Am I missing anything there? Please see attached screenshots. I know, it was on Jan that you have completed this. Just let me know if you see anything obvious that I do incorrectly. 
m99gaoa413yn.jpgyvt5kl7mr0km.jpg0h1pf12erlw2.jpg

madhawap
Explorer
@"alex.chesser" found a post from you here https: //forum.unity.com/threads/oculus-handtracking-with-custom-hand-model.810678/  on the same topic. If anyone else looking to implement the same. I am still struggling to get it working though. 

I added FingerIK.cs to Ch16_nonPBR@Idle and HandTrackingFingerMap.cs to mixamorig:LeftHand.
Then added OVRHandPrefab Left and Right and 
mixamorig:LeftHand and mixamorig:RightHand to FingerIK.cs. Still, it is not working. 😞 

9b01mexij3mb.jpg