Vertex Color not imported if mesh has a material

Godot Version

4.3 stable and 4.4 stable
Blender 4.3.2 and Blender 4.4.0

Question

I’m trying to setup a workflow in blender to godot, where I would be using a combination of texture painting for the object, and vertex color information in order to pass some data to a custom shader.

The issue I have with this is that the vertex color info seems to be disappearing from the moment I put a material on the blender object.

I use the blend file in the godot project for this post, but I did test with gltf export and tiggling with the export option relative to the vertex color didn’t yield much success.

As I’m a newbie with Blender, I suspect there might be a setting I’m missing in my Blender Project setup ?

Screenshots


Current workaround

I did find a workaround :

1 - Create my texture painting image, paint it in blender, UV unwrap etc, then save the image to the Godot project folder.

2 - Paint the vertex colors

3 - Delete the material from blender before importing the object in Godot

4 - In godot, create a material based on the texture image painted in blender.

If it was a one time deal it would be okay but I find this setup tedious as my models often needs some modifications

did you find any solution to this? having the same issue

I just had this issue today and found that the vertex colors import correctly into Godot from Blender when I plug the desired color attribute into the material somewhere before hopping over to godot. I’m not sure why it works this way, but that’s the least tedious solution I could find.

In my case though I have the .blend files set up in my project directory and the blender path defined for direct importing rather than using Glb or Gltf: here

Using Godot 4.5 stable and Blender 4.5.3LTS.

Can you describe more how you fixed it?

I don’t understand this part:

when I plug the desired color attribute into the material somewhere

I’m pretty sure it’s because of the settings. File → Export → glTF, then a dialog shows up and in the options tree you expand Data → Mesh → Vertex Colors. In there you have several options, which in my version are: Either don’t export the vertex color, or only export the active one, or only export it when it’s being used by a material. Then there’s two checkboxes: One exports all vertex colors even if not used by a material, but it says it changes something in a way I don’t understand. The other one exports the active vertex color when there’s no material.

I guess this in tandem with Material → Materials = Export/Placeholder/No export causes an unforeseen result in some combinations? Also, I have no idea what a vertex color being “active” means; I’ve never used or exported vertex colors…

What I usually do to export color attributes is to (in Blender) click the yellow dot left of the Base Color property on my material, and then I select “Color Attribute” as the color source. This makes sure the vertex colors get exported correctly.