Character Animation on Combined Meshes

Hi, I’m having a problem with combining meshes and applying animation to one GameObject. Say I want to make a Character of X body parts. Each part is a mesh with bones, bone weights, and binding poses. The bones are the same in each mesh. I’m able to combine all the meshes into one SkinnedMeshRenderer, however when I attach an animation to the game object, the meshes don’t move.

Hierarchy:
CharacterGameObject (contains: Animation Component, Animation script, Combined Meshes in one SkinnedMeshRenderer)
→ (child node) Skeleton joints

The joints on the skeleton moves, but the meshes don’t. I tried putting the meshes on the joints, they move, but the transform is incorrect.

I tried:
CombineChildrenBones script: http://answers.unity3d.com/questions/8602/combining-meshes-for-independently-moving-objects
CombineSkinnedMeshes: http://forum.unity3d.com/viewtopic.php?t=23340&postdays=0&postorder=asc&start=0

Any ideas?
Thanks

What I had to do to get multiple meshes on one skeleton is export one file which contained all meshes and the single skeleton. Then they all animate with it correctly and can be separated and reattached and still work.

Skeleton
-Mesh.Cutscene
-Mesh.Hires
-Mesh.Lores
-Mesh.Cloth
etc.

In-game I’d disable/enable unwanted meshes on the fly.

I haven’t found a way to tell meshes that their source bones can be found in any particular hierarchy.

thanks for the suggestion. When I do export one skeleton with multiple meshes, the animations work. However I want it to work with the following inputs, for example, the exported files are:

Head.fbx: contains the full skeleton starting at WorldRoot. WorldRoot contains the SkinnedMeshRenderer with the head mesh material.

Upperbody.fbx: contains the full skeleton at WorldRoot. Upperbody mesh attached to the SkinnedMeshRenderer on the WorldRoot.

Lowerbody.fbx: full skeleton at WorldRoot with a SkinnedMeshRenderer.

Now when the game runs, I wrote a script to combine fbx to one GameObject, called “Character” with the following hierarchy:

Character
→ Head
—> WorldRoot (with SkinnedMeshRenderer)
→ Upperbody
—> WorldRoot (with SkinnedMeshRenderer)
→ Lowerbody
—> WorldRoot (with SkinnedMeshRenderer)

Then attaching an animation clip to Head, Upperbody Lowerbody, the character animations. But it feels that the WorldRoot is redundant.

I combined all meshes in the 3 SkinnedMeshRenderer into one mesh in 1 SkinnedMeshRenderer (SMR) and attached this one SMR to just the Head child removed the rest other objects: Upperbody Lowerbody.

Character
→ Head
—> WorldRoot (with combined SkinnedMeshRenderer)

but attaching an animation file only animates the head mesh not the upper and lower body meshes.

Any ideas what I did wrong?
Is it possible to decompose those fbx’s into one WorldRoot one SkinnedMeshRenderer with a combined mesh?

I’m having the same problem!

I believe that the best solution should be:

create a gameobject, character;

and find a way to attach to it the Animation (.anim) the Skeleton, the Skined Mesh and the Mesh.

If anyone have a solution to don’t replicate the bones structure several times, please stand up.

The Character Customization project (Character Customization | Utilities Tools | Unity Asset Store) somehow does this successfully, but unfortunately the project doesn’t come with a good description of how it is done. It is up to us to dissect the project and figure it out.

Can someone PLEASE explain how the meshes are combined and use a single skeleton with weighted vertices from a CONCEPTUAL level? Diagrams are always helpful when trying to understand things from a conceptual level.

In the project I see that it makes collections of materials, bones and meshes that are combined and somehow work. How do the vertices know what bones to use after combining? I thought bone weights referenced bones by index, not name, but this seems to somehow be using bone names. Please explain.

A simplified example of combining meshes into a single animated skinned mesh would go a long way for a lot of people. Mixing this topic with AssetBundles just complicates the subject.

Animations animate bones by name, but meshes follow the bones by index. How to get a mesh to recognize bones though, I’ve forgotten. I’ll dig through my old notes and see if there’s something.

Oh GOD please pin this thread on top so it won’t be buried.