• 3D
  • 3D Rigged/Animated Characters and (interchangeable) clothing

What is the best way to handle swappable armor,clothing/weapons and animations? I want to animate my character, but I'm hesitating because I dont know how to handle the animation of the equipment that can change over time.

So for stuff like armor, you can have bone attachment points. So on the arm (let's say) of the character model, you can make a point that the armor will snap onto. This is easier to rigid objects that don't deform, like armor, weapons, hats, etc. For clothing it is more complicated. Since you will have to rig the clothing with the same animation as the characters, and make sure there are no issues or else you will get clipping. In Blender (or other 3D apps) you can transfer the bone weights from one object to the next.

So after your character is animated (you can create and animate the character first, that is fine), model the cloths on the character base pose. You can copy the model vertices so they are the same, this may make some stuff easier. Then transfer the bone weights to the clothing model. Ideally everything would work, but you'll probably have to smooth out some points (especially around joints like the knees or shoulders, etc.). But that should get you like 90% there.

Does this means that in Godot each clothing will need to have its own baked animations that align with character's animations?

For example, if I have a character with walking and running animation then I need to also import a mesh pants and a shorts with matching walking/running animation then swap them around using script?

I'm not sure. I know you can do it in Blender fine, but Godot is somewhat limited with sharing animations between models. There is a proposal for animation retargeting coming for Godot 4.0, but I'm not sure how long that will be. Currently I think in Godot you can use the same animation on two models but they have to be almost exactly the same (or at least the exact same skeleton). I haven't tried it, but I know it is limited. For example in other engines you would make your base model and export an fbx with no animations, and then export just the animation in another fbx, which could be shared with multiple characters. But AFAIK Godot doesn't support that. I think you can still have clothing but it would require more work in Blender and potentially duplicating some work.

2 years later

I know it's an old post, but I'm currently exploring the topic.

I saw this video :

I havent' tested it but will try it shortly, in theory would this work ? :

Make 1 base mesh with skeleton attached. Head, Torso and Legs separated
You can then make clothing in those 3 slots that replace the mesh itself, before exporting, you  attach it to the skeleton like in the video. 

Import in godot, merge from scene then save that mesh as a packedscene. 
Then when equipping clothing, just hide the base mesh and add the packedscene as a child

    Loxyrak I havent' tested it but will try it shortly, in theory would this work ? :

    The method in the video may well work, but it is very restrictive on the clothes you use.

    I saw this video :

    This video uses MakeHuman. Here's a detailed tutorial:

      Tomcat Thanks for the response ! I won't use MakeHuman but I will check it out.

      I can confirm this works fine in Godot 4.0. In Blender you just make a separate object for each clothing item, parented to the skeleton rig with bone weights, like you do with the body, and export the rig, body, and clothes. Then in Godot you can show/hide individual clothing items. This also works for hair styles.

      I've also tested exporting clothing items separately, as many AAA games do. You just have to export clothing item and the rig (but not animations). Then you just need a bit of Godot code to copy the clothing node into your character node. So an artist or modder only needs a blender file with the rig and body in order to create new clothing items.

        3 months later

        Lol I;ve known about this for years

        RadThadd How do I hide meshes underneath other ones?

        Usually the part of the body that is under the clothes is masked (cut out). If the clothes are not changeable, this is a workable option.

        RadThadd In my project I have character body split into few parts (like head, chest, arms, hands, legs etc.) and whenever I show cloth on my character I just hide all parts of body that are fully obscured (that is just configured per each cloth object by hand. If you have a hood you probably don't want to hide whole head of character, but if you have some helmet covering whole head and face you can just hide it). Of course sometimes you can't just hide body part, because some parts should be visible, anyway I am trying to always keep minimum body parts required that way even when some clipping happens during animations it is hard to notice in most cases.

        RadThadd Yeah, it's hard. Either increase your shrinkwrap offset or do like these guys ^

        For skintight clothes like underwear and swimsuits it's ideal to bake them into the body texture, either as a replacement material or a transparent overlay (Next Pass on the base material). That adds complications, like having to make the base material unique (with mat.duplicate(true) in your wear-item script) which hurts performance.

        @GlyphTheWolf's method of splitting the body into several nodes is probably the most convenient way to control visibility in Godot. Unlike materials it will only affect one character, not every instance of the same model, and I know it works because I'm already doing the same thing with clothes.