Swapping Meshes on Skeletons Godot

My Problem

I have a character model. It has armour pieces that will need to be swapped out with better gear over time. I want those armour pieces to deform with the players skeleton. Sounds pretty simple but was a lot harder to figure out and resources online were barebones at best.

The Solution

First, export your base model. I personally export as a gltf2.0 file instead of the blend import just so I don’t push changes to my game that I don’t want. When importing into godot I recommend checking Trimming and Remove Immutable as it fixes some issues with the animation tracks.

For me, the model has each limb as a mesh I can disable. This is because the new meshes will directly replace these. Your’s may be a complete base mesh and you want to overlay clothes or armour on top. This works the same way for that.

skeleton hierarchy skeleton hierarchy

Now let’s say I want to swap out my right arm for a new piece of armour. In blender I have modelled a brand new, and very fancy arm on the same character model! skeleton hierarchy

Do all the regular stuff you need to do to it (weight painting, parenting, etc) and then you need to select the new model and the armature.

skeleton hierarchy

Then export with Limit to Selected Objects checked.

In the Godot Advanced Importer you should get something like this:

skeleton hierarchy

Skip the AnimationPlayer import as we don’t need it.

Now this is where it gets a bit messy. We needed to export the armature to maintain the meshes connection to it, but that is now stored within the mesh. This means we can get rid of all the extra nodes and just have a mesh. The best way I have found so far is to open up that inherited scene, duplicate the mesh and save it on it’s own as a new scene. The obvious drawback with this is you will have to do this every time you want to change something about this mesh. (if you know a better way lmk @precipire on Discord)

skeleton hierarchy

Once this is done you will have a scene containing your new mesh and all you have to do it drag n drop it onto the skeleton:

skeleton hierarchy

The mesh is deformed, in the right spot, and animates like it was there the whole time!