- Home /
SkinnedMeshRenderer missing bone
I'm importing an FBX from 3Ds Max that has two meshes sharing a single skeleton. The hierarchy looks like this:
FBX
-> SkinnedMesh1
-> SkinnedMesh2
-> SkeletonRoot
--> bone1
---> etc...
When I bundle the fbx I create 3 separate bundles, one for each mesh and one for the skeleton. In 3Ds Max both meshes have 'SkeletonRoot' as the root bone, but when I'm looking through the bones array on the SkinnedMeshRenderer the first mesh will have 'SkeletonRoot' as the root node, but the second mesh will have 'bone1' as the root node with 'SkeletonRoot' missing completely. I believe that it is because of that that the second mesh won't animate when I import the bundles and create the GameObjects.
I'm doing this with several other FBXs imported from 3Ds Max with no issues, any ideas why this might be happening? Thanks!
Answer by etreworgy · Sep 13, 2011 at 08:43 PM
Fixed the problem by adding weight and a animation key to the root bone for the 2nd mesh. Seems that the FBX import/export process leaves out unused bones, even if they're important to the hierarchy.
I found a method that doesn't add "real" weight:
It is true that the FBX exporter doesn't add weightless bones to the skinned mesh (they export as objects normally). Thus, the bones array of the Skinned$$anonymous$$eshRenderer in Unity has only those bones which have a weight to them. The trick is to give each bone a weight in $$anonymous$$ax... But this weight can be 0! As long as the weight table doesn't read "-", the bone counts are being weighed and will be fine. I just marked all vertices inside the weight table and typed in a value 0f 0.01 for all bones, then typed in 1.0 for the one bone that actually needed to influence vertices (a weapon, in this case). The other weighs will then be set to 0 (but not "-"). For complex rigs, it might be neccessary to set the Bone Affect Limit higher (in the Skin $$anonymous$$odifier's Advanced Parameters Rollout).
Similar question by me:
Weightless bones don't get added to Skinned$$anonymous$$eshRenderer bone array?!?
Your answer
Follow this Question
Related Questions
Why are identical skeleton FBX imported differently if there is a mesh in the Scene? 2 Answers
Blender Skeleton Animation Import Problem. 1 Answer
Mb to fbx strange crushing issue 2 Answers
Root Level disappear when import fbx 0 Answers
Problem with exporting skinning-data from 3ds Max to Unity 1 Answer