- Home /
is it possible to animate a mesh that was imported with another model?
I have 3 objects imported from blender. they were made from the same file and their armatures are identical in every way but they are not actually the same. the first is a naked model, the second is a mess of clothes and the third is just the armature I thought I'd use this one as a clothes-slot in instances of the first. The second is way too big to use in full even once. I could divide it up but I want to be able to mix it up freely, so I put a skinned mesh renderer and an animation controller in the third one and put it in an instance of the first and put a mesh from the second into the skinned mesh renderer. The clothes show up correctly scaled and positioned and they move along with "Root Bone", but only the instance of the first is animated. All 3 are correctly configured and the instance of the first animates correctly no matter which of the 3 avatars it uses. Is there something else I need to reference to get the clothes to animate, is there some other good way of doing this or is it simply impossible?
in short I think I'm having trouble binding an avatar to a mesh.
Answer by Cherno · Apr 22, 2015 at 06:41 PM
Maybe this will help:
yeah I think I'm on to it now something with the skinnedmeshrenderer.bones. I was hoping to do this without scripting, both in case it doesn't work and because it's a little more complex than I was hoping for, but It could be the ultimate and optimal solution so I'll give it a shoot.
yes it was easy to fix with script.
void Start () {
Skinned$$anonymous$$eshRenderer smrenderer = gameObject.GetComponent<Skinned$$anonymous$$eshRenderer>();
GameObject mgameobjekt = GameObject.Find("Body");
Skinned$$anonymous$$eshRenderer smrendererRef = mgameobjekt.GetComponent<Skinned$$anonymous$$eshRenderer>();
smrenderer.bones = smrendererRef.bones;
}
I just had to add this script in the object with the skinned mesh renderer that didn't work and I got the perfect solution I was looking for. I kinda figured it out on my own, but I'll give you a win.