# \[solved\] CGE doesn't load/process some GLB models

**URL:** <https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158>\
**Category:** Bugs\
**Created:** [May 31, 2026, 9:39am UTC](https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158 "2026-05-31T09:39:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NiunioMartinez](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/niuniomartinez/32/2232_2.png) [@NiunioMartinez](https://forum.castle-engine.io/u/NiunioMartinez)\
**Post date:** [May 31, 2026, 9:39am UTC](https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158/1 "2026-05-31T09:39:18Z")

</div>

I’ve found that CGE doesn’t load some models. These models are [Kenney’s mini character 1](https://opengameart.org/content/mini-character-1). I’ve attached them for convenience at the end of this post. In some cases it gets only the head, other times it gets only the body. Some times it identifies the animations, some times it doesn’t. I can’t see a pattern (the same model in the same project have different behaviors at different times [moon phases?]).

To replicate just create a new project with a 3D viewport and insert any of the models. An example of what I see:

 ![Captura de pantalla_2026-05-23_13-48-01](https://forum.castle-engine.io/uploads/default/original/2X/a/adda3dc4ec66c1c3170c36e3c2e54a63304295d2.png)

I downloaded the engine again one or two weeks ago, so it’s pretty new. Older versions did work well using the same models (I’ve found [this thread](https://forum.castle-engine.io/t/problem-with-capsule-autosize/1502) and in that time I remember it worked).

A friend tested the models in Unreal and they work flawlessly.

None of these models work in CGE: [mini-characters.tar.gz](https://forum.castle-engine.io/uploads/short-url/sbdq31NMkGbDp90nr6hofDtN9LL.gz) (235.4 KB)

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 31, 2026, 7:39pm UTC](https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158/2 "2026-05-31T19:39:17Z")

</div>

Hello there!

When I opened the file with Blender I see the head and the body are 2 separate objects.

If they were part of the same object tree, like Person (the root) → Head (first child) → Body (second child), then it’d load with no problems. I often use models with dozens of child objects without issues.

The designer’s choice was to make 2 objects, but both share all the same stuff and have only different mesh. And here’s the good news.

1. You can import the model to Blender, selecting option “Import scene as collection”. Then select all (head and body) and export to gltf / glb with “Selected objects” option. You save few kilobytes, too. See:

[kenny\_fem\_b\_2.glb](https://forum.castle-engine.io/uploads/short-url/qdqqzBfQqJuWIdVubYE8DiJGxUW.glb) (207.7 KB)

1. You can also join the 2 meshes into single 1. Just select both: head and body, right-click and select “Join”. Then export “Selected objects” back to glb. It preserves the skeleton, because it’s shared, and you can still animate / pose things. This way you clean up the model, and the file size is considerably smaller, but it’s absolutely optional. See:

[kenny\_fem\_b.glb](https://forum.castle-engine.io/uploads/short-url/o795euN9OikKerz9bmUvsvT0t8w.glb) (66.2 KB)

I think that the problem arise only because CGE expects one object, or precisely 1 object’s tree. When 2 or more trees are present, the first to load is the one that CGE picks - that explains why you randomly see either the head or the body. Vast majority of models I’ve seen are 1 tree, so I doubt it’ll be worth hacking the gltf loader for the few exceptions.

Anyway, I hope my answer helped a bit.

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [June 1, 2026, 6:16pm UTC](https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158/3 "2026-06-01T18:16:56Z")

</div>

I’ve looked into the raw data of the file. The file was originally exported with UnityGLTF, and has one scene root `"scenes":[{"nodes":[0],"name":"character-female-b"}]`so it’s not a multi-root model. The real problem is skinning: there are 2 mesh node that reference different skin indices:

- `{"skin":0,"mesh":0,"name":"body-mesh"}`  
`{"skin":1,"mesh":1,"name":"head-mesh"}`

but both skins refer to the same identical joints list

- `{“inverseBindMatrices”:420,`  
`“joints”:[1,2,3,4,5,6,7]`  
`},`  
`{“inverseBindMatrices”:423,`  
`“joints”:[1,2,3,4,5,6,7]`  
`}`

The solutions that I suggested earlier **still apply** : you either join the meshes or make them use the same skin. I have confirmed it on few models, and all re-exported ones exhibit lack of repeated identical joints.

I think @michalis is the best person to decide if CGE should merge identical joints. In my humble opinion, the Unity’s exporter produces valid glTF, and their ways are possibly not so unique.

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [June 4, 2026, 4:33pm UTC](https://forum.castle-engine.io/t/solved-cge-doesnt-load-process-some-glb-models/2158/4 "2026-06-04T16:33:51Z")

</div>

Thank you a ton @NiunioMartinez for the precise bugreport and then for analysis from @DiggiDoggi . You both made my work easy 🙂

In short: fixed in the latest engine version! 🙂

As usual, the [downloads](https://castle-engine.io/download) will contain the fix after it passes a few automatic tests. You can observe [this page](https://github.com/castle-engine/castle-engine/compare/snapshot...master), when it will no longer show the commit _“Handle glTF files containing multiple equivalent skins…”_ then the fix is part of the downloads.

Details, if you’re curious what / how / why:

1. The limitation on the CGE side (only partially “lifted” now), causing this, is that we cannot have _1 joint affected by 2 different skins_. And this is what these models use, as investigation from @DiggiDoggi shows – 2 skins, and their “joints” list are equal. They actually share the whole “skeleton” which equals to “root joint” in our terminology.

2. There was a talk at glTF whether such models should be allowed, see here for all the details and discussion that I followed to some extent: [Stricter Skinning Requirements · Issue #1665 · KhronosGroup/glTF · GitHub](https://github.com/KhronosGroup/glTF/issues/1665)

3. The 2 GitHub issues linked above contain claims that other game engines also don’t support complicated skins (see e.g. statement _“No game engine supports binding a mesh to multiple skins. If an exporter wants to do this, it needs to join both skeletons.”_). So, I believe _Castle Game Engine_ is not alone in this limitation… but I didn’t check in practice how does it look. Information in this thread suggests that Unity and Unreal support it at least to some extent (maybe using a similar hack to only support specific cases, like we just did, read on 🙂 ).

4. What did we do now?

5. For this specific case, we can do more, since actually the 2 skins are _exactly the same_. They use the same joints with the same “inverse bind matrices”. We can just put all affected shapes in one skin, and we’re good.

Have fun making games!

 ![image](https://forum.castle-engine.io/uploads/default/original/2X/c/c27e018b1c770a1aac70f5b88419b9911375518d.png)
