Setting up a palette of shared materials on a large number of .glb assets - what to do with imported materials

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kim Holder

I am trying to set up a large set of imported 3d objects to all use the same palette of materials, which are stored in a SharedAsset / Materials folder.

I exported them all as .glb from Blender, with materials, because otherwise all objects that use more than one material lose their material slots. I set them up with only very simple materials in almost all cases, so the included materials are small files, but now it seems they can’t be deleted without causing problems.

I want to delete the materials that are created when inherited files are created, so that the shared palette can be used instead, and the total count of materials can be greatly reduced. But Godot reports the .glb has missing dependencies if I delete its materials. It will still open fine, but there is a list of warnings.

If i don’t delete the materials, i worry that the entire point of having one set of materials that are widely shared among many objects is defeated. If I do, I worry the missing dependency issue will cause problems.

So, what are the options here? Can we get away with those missing dependencies existing, since they have no effect? Can we leave those materials there, since they are simple, small files - even though there will be hundreds of them, each one being an exact copy of one of the materials in the palette, in almost all cases, including the name? What are the penalties?

Hi Kim,
I’m trying to solve the same problem. From what I’ve seen, Blender’s glTF exports will use the same materials if you export everything to the same directory. This seems very hard to deal with for a project of any size.
What do you mean when you say “because otherwise the file has no material slots.”?
I’ve been able to export a mesh with no materials (or blender’s default), then open it in godot and pick “New Inherited”, then assign an existing .tres file to it.
So I think the best approach might be to export with no materials, then assign the material from a shared material folder in Godot.

BTW, you project looks very interesting. I signed up for your mailing list.

chrisbare | 2020-03-02 03:22

Hi Chris
I edited the question to clarify - any object that uses more than one material will no longer have separate slots for each material.
I have been able to replace materials on objects with ones from the shared assets, but the next time I open the project, they are gone. It’s only when the materials that are generated in the object’s folder are edited that the changes work. Now, that does allow me to share textures among many objects, which perhaps is almost as good. It makes it easy to mix and match textures to create different effects without using more textures. I just worry about the sheer number of materials. Our design has many objects with multiple simple materials that don’t use textures. If I counted them all up I bet there are a couple of thousand now.
I’m really glad you like our project. I hope to get a newsletter out in the next couple of weeks. Thanks for signing up.

Kim Holder | 2020-03-02 15:04

:bust_in_silhouette: Reply From: Kim Holder

Well, setting up a test project shows that if the materials are removed, even though the scene will open, it won’t run.

I’m sure that was obvious to everyone but I’d like to make a point about that. I’m an artist working with a team of coders remotely. I have tried to learn enough Godot to do my job, but i’m not a coder, and it’s hard for me to get help from the team due to the remote work situation. I’ve never found any docs or videos that see things from the perspective of the kind of work i’m trying to do. I have to figure it out by trial and error most of the time, and it often costs me days of lost work. Seriously, that has happened a bunch of times. Which also means lost money, because I’m the one paying everyone else. I stick with Godot only because it is open source, and put up with that.