External Material not applying to model

Godot Version

4.6.1

Question

Hello!

I’m trying to prototype a game using Kaykit’s free character pack.

In the pack, I have some gltf files for weapons (sword, shield, etc). I imported the axe_1handed.gltf and axe_1handed.bin files in my project. Only the gltf file appears in the hierarchy, and if I double-click it, it shows up untextured (white).

If I drag and drop the barbarian_texture.png file in the same directory as my axe_1handed.gltf, the axe is now textured. If I rename the texture, the axe is untextured.

Earlier in the project, I imported the barbarian model, and already created a material for the barbarian. To avoid duplication, I’m trying to make the axe use the already existing material.

I double-clicked on the axe_1handed.gltf, went to materials → barbarian, enabled “use external”, set the path to my existing barbarian.tres material, and clicked reimport.

The axe remains untextured.

I do not understand why, even after setting the external material, the axe still relies on barbarian_texture.png being present in the same directory to have texture.

I’m a Godot beginner, so it’s likely that I misunderstood the way materials/textures work.

Thanks in advance for any help/explanation.

The best answer I can give you is to provide the answers directly from KayKit. In this video he answers exactly how to do what you are asking in detail.

2 Likes

Thanks, I should have added that I actually ran into the issue while following this video. :sweat_smile:

  1. Copy Axe the .gltf, .bin and .png files into the weapons directory (or whatever).
  2. Copy the .png into the assets/textures directory (or wherever you want to store the textures). You cannot delete these later.
  3. Copy the barbarian .glb file into the characters directory (or whatever).
  4. Go to the Barbarian advanced import options and save the material to the assets/materials directory (or wherever you want to store materials).
  5. Reimport it.
  6. Open the new barbarian.tres material.
  7. Go to Color → Albedo and replace the Texture with the one in the assets/textures directory. (You can drag-and-drop it.)
  8. Delete the barbarian texture in the characters directory.
  9. Go to the axe’s advanced import options and set it to use an external material. Point it towards the barbarian.tres in the assets/materials directory.
  10. Reimport it.
  11. Delete the .png in the weapons directory - only if everything that uses it has already been imported.
1 Like

Thanks.

I’ve been following the video you linked, at this point I already have the Barbarian character using the external material, and I deleted the texture in the Characters directory.

The problem arises when I try to get the weapon to use the material the barbarian uses.
I recorded a video of what I’m doing:

I don’t show it again after the final click on “reimport”, but the axe remains white.

There’s obviously something I’m missing, thanks a lot for taking the time to help. :ok_hand:

So the compression makes it blurry at the beginning when you hover over the texture, but from the texture name length I think you are using the old texture. But maybe not.

I believe the issue is you are re-importing the axe after you delete the texture. Just opening up the Advanced dialogue causes it to recalculate and look for that original texture. (In the case of the Barbarian model, if you do that it will re-generate the texture.)

This is an example of me following the same process with the Orc Raider and Orc Club objects. If you look at the mesh of the club in the inspector, you can see under Mesh → Surface 0 → Material that it’s using the orc_texture_A material I made.

To check if the axe is loaded correctly, right-click on the .gltf and select New Inherited Scene. If it looks good there, do not open the Advanced import dialogue again.

1 Like

You are indeed right. After deleting the texture, creating a new inherited scene shows the axe fully textured. Even if I reimport it, it’s still fully textured.

I now realize the mistake I made. I failed to understand that what is displayed when double-clicking the axe gltf in the file hierarchy is NOT a preview of the model, but the import settings. From the moment I change the settings to use an existing material within my project, I no longer import a fully textured axe, and it makes perfect sense that only the untextured 3D model is displayed.

Thank you for taking the time to help me.

1 Like