How to get a specific bone, based on which bone mecanim maps it to

Hi,

I want to be able to access a bone of an imported model, but I don’t know what the name of the bone will be, so I want to access it based on what bone mecanim defines it as.
eg: I want to get the the left hand bone, but it’s called “bone07” so I can’t check for names in the hierarchy, but mecanim knows it’s the left hand bone, so if I could found out what Transform that is then problem solved.

So basically I want to know which bone maps to what.

Anyone know how to do this?
I thought I could access it through the Avatar, but no such luck.

does this thread help?:

Yes, thank you!
I knew there had to be a way, but somehow couldn’t find it .
(I swear I searched for it before asking)

thanks for the help!

Edit:
problem not solved;
I seem to have to access the bones by the Animator (controller)
The problem is that I’m doing this all when the model is being imported, so there is no Animator.

Maybe I can temporarily create an Animator, and assign the avatar (which if I understand everything correctly, is the thing that actually contains the data I wanted, it’s just not accessible directly), but I don’t know how to get the Avatar at import time either. :frowning:

It seems like I might be able to get the mapping info from the metadata.
I opened it in notepad and it clearly says which bone maps to what.

Edit: Nope, I was wrong, the names I see there are just the display names in the mecanim editor window thingy (at least I think so), they are not the actual bone names.

So, I still have no idea how to get the mapping info. :s