Skeletal animations with interchangeable meshes

Godot Version

V4.02.1

Question

Hi all,

First off; working with animations is new to me. I’m trying my best but please be patient :slight_smile:

I am trying to make a player character, with interchangeable bodyparts/clothes. So you can choose your head, body, legs, and hair. I want the entire thing to be animated as well.
I don’t want to do any double work animation-wise. So I have made a simple model in Blender with 4 different meshes and 1 skeleton, and made some simple animations.

This I could export to GLB and import into GoDot. This works perfectly fine.
(don’t look at the horrible rigging job. As i’ve said, i’m new at this)

But, now I want to replace the 4 meshes. And I want to be able to do this on the fly.
So, my intention was to create a new model (with the same skeleton ofcours) for one of the bodyparts, i.e. new Legs. And to replace the current Legs node on the Skeleton3D node with the newly loaded model.

So I made the following code in PlayerModel.cs

    private MeshInstance3D _bodyMesh;
    [Export]
    public MeshInstance3D BodyMesh 
    {
        get => _bodyMesh;
        set
        {
            Skeleton.RemoveChild(_bodyMesh);
            _bodyMesh = value;
            Skeleton.AddChild(_bodyMesh);
        } 
    }

But I am running into a wall right now… when the new model is exported as .GLB, i cannot just import it as a mesh file and replace it. When using a .OBJ file, the rigging information is lost.

The intention is to make making new clothes and bodyparts as simple as posible; make sure the rigging is properly done, export it, and you should be done. You should need to worry about the animations on this part; as those are someone elses problem at that point.

Surely there is a way simpler way of achieving what I want, but I can’t find or think of a proper solution.
Can someone give me a push in the proper direction please?
Thanks :slight_smile: