Note - critically, Bunny has determined that changing the field in question in the inspector, is meaningless, just an error on Unity's part. Changing that field in the inspector actually does absolutely nothing. It is a read-only value.
This is a huge finding and we should all seriously thank Bunny83 for this.
Anther triumph of the rare smart user v. utterly useless indeed missing documentation.
(Rephrasing this slightly...)
If you look in the Inspector at your SkinnedMeshRenderer, you will see the #7 item (just after Mesh and just before Bounds) is "RootBone"
Can anyone please state, using either Unityscript or c#, how to get what the Panel there refers to as the "Root Bone" of that object? As shown in the image below with red arrows. Thanks!!
As Bunny, thank God, absolutely precisely explains ...
"In [a] Mesh, a vertex can be bound to four different bones...
The bones are specified by a bone-index...
[from] the bones array of the SkinnedMeshRenderer...
[ie, the array SkinnedMeshRenderer.bones]"
So, WTF is the "Root Bone"??
Is it the 0 element of SkinnedMeshRenderer.bones, or is that naif, or what? THANKS!
I've posted it already on your other question as comment, but once more ;)
A SkinnedMeshRenderer doesn't have something like a root bone. It doesn't even care about the bone-hierarchy. The SkinnedMeshRenderer just needs an array with all bones in the order they are bound in the mesh. This reference is setup by the Mesh importer. It creates the bone hierarchy and assigns all bones to the bones array. In the Mesh a vertex can be bound to 4 different bones. The bones are specified by a bone-index. This index is related to the bones array of the SkinnedMeshRenderer.
Again, the bone-hierarchy is irrelevant for the SkinnedMeshRenderer. The hierarchy is just an automatic way for affecting subbones, but on the skinning level there are just bones.
Another important array is the Mesh.bindposes - array. It specifies the "resting position" of each bone. The example shows how to create a very very simple model with two bones.
It's almost impossible to "simply" assign a bone structure to a certain skinned mesh because you have no idea of the bones order. You can of course try to determine which bone belongs to which index by calculating the mean of all vertices that are affected by a bone. That usually gives you the approximate position of the bone, but it's not really reliable.
For imported models, the connection - information is imported by the MeshImporter and is stored in the bones array.
Here's an example print of our player characters bone array:
As you can see the first bone isn't the root bone (Bip001). It conpletely depends on how the model has been created and how the modelling software has exported the bones.
There is no general rul how you "usually" add bones to the array. It doesn't matter, it's just important that they are in the same order you used in your Mesh.
*edit*: (Let's make this answer a bit longer x) )
Here's the hierarchy of the bones, just as reference:
I've used this little script: