Open Knairda0 opened 1 month ago
We need to add that setting into the godot blend importer. I will be away next week so others may be able to review pull requests.
In modules\gltf\editor\editor_scene_importer_blend.cpp
we get parameters_map["export_vertex_color"] = "MATERIAL";
if Mesh colour export is set to true in the Editor.
However, if you check the documentation: https://docs.blender.org/api/current/bpy.ops.export_scene.html you'll see that this option means Export vertex color when used by material
, hence why Vertex colours aren't being exported if there isn't a material attached.
Switched the option from MATERIAL
to ACTIVE
in code and that seems to fix it. (Note, had to edit Blender file to update links to image files for textures).
Tested versions
System information
MacOS 15.0.1 - M1 Pro - Vulkan (Forward+)
Issue description
Godot's Blender file importer inconsistently imports vertex colors on a per-mesh basis.
You CAN get around this by using the .glb exporter in Blender, and selecting "Use Vertex Color: Active," however, there is no such setting or default behavior for importing .blend files.
Advanced import view for the example .blend file (note the white meshes with missing color)
Advanced import view for an .glb export of the example .blend file (with colors working as intended):
Steps to reproduce
After countless hours of testing and troubleshooting, I honestly don't know how to get around this without that .glb export setting. My guesses have been:
However, I haven't been able to identify any consistent behaviors.
Minimal reproduction project (MRP)
The MRP contains the .blend file, .glb export, and a basic 3D scene with the models placed down.
blender-vertex-color-mrp.zip