- Home /
Swap mesh parts i.e. attach one skinned mesh to another via bone
Hi all,
I have a character, say, a robot that is customisable. He has many different mashes for hands, feet etc and they are interchangeable and have their own animations and textures. I want to be able to attach a part to another part and still retain its own animation and textures but move according to its new parent transform. For example I have a torso skinned mesh and need to attach an arm at the shoulder bone.
I've seen examples where people say to have one whole animated skeleton and then make parts with the same bone names for that part and replace them but the point is that one hand may have a different animation to another hand, I just need to make sure that the shoulder bone of the arm is attached to the shoulder bone of the torso so that it positions itself accordingly.
I've tried setting the parent of the root of the arm to the shoulder transform of the torso but it doesn't seem to position itself correctly and the animation on the arm stops working, I'm guessing as the animation file is now looking at a different bone hierarchy. Although the arm does seem to move relative to the movement of the torso as it animates.
Any ideas on how to achieve what I'm after?
just TBC. you could make a selection of totally independent arms (that you could bolt on a wall or whatever), and you could bolt those on to the independent body. {and then "merely" write brilliant software to sync everything, etc.) of course, it wouldn't skin (it would look like - say - a turret on a tank, or playmobil)
that simple solution is no good for you right? you want one real skinned real cohesive unit?
I realise that for now it would look and move dismembered, as in the new limb wouldn't pull on skin of the other limb. It is my intention to have a fleshy character so adding bone weights will be necessary but that is another problem for another day. I figure I'll just share the bone weights at the joint 50/50 or something.
if you are familiar with building your own skin and bones on the fly, for sure.
yeah, I'm afraid I don't know any quick fixes for swapping in a variety of parts with the same underlying animations ... I'm sorry :O
maybe the new $$anonymous$$ecanim system is more friendly for swapping in a variety of parts with the same underlying animations? cheers!
Answer by EvilWeebl · Oct 15, 2012 at 06:17 PM
Well what if the parts weren't actually connected but instead on update the bone transform was set to the transform of the other i.e. the shoulder bone transform of the arm was set to the transform of the shoulder bone of the torso. Although doing this they really are separate meshes and I indeed wouldn't be able to configure bone weights between the two...would I?
So am I left with taking the info of all meshes, stripping them down and building a new skinned mesh from scratch in code? I've seen this done but never done it myself, would there be a specific order I would need to add the vertices of all the associated limbs? And how would the separate animations and textures work on only the correct parts? My god why cant I ever try and achieve something easy?
Your answer
Follow this Question
Related Questions
Skinning character (attaching mesh to skeleton) 2 Answers
How to move/rotate joints using c#? 1 Answer
Applying different boneWeights to SkinnedMeshRenderer creates unwanted vert stretching 2 Answers
is there a way to include bvh file in unity ? 0 Answers
Why extra/additional bones don't work with @ animation pipeline? 0 Answers