summaryrefslogtreecommitdiffstats
path: root/modules/gltf/editor
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gltf/editor')
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 79a2184745..519e2646a0 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -188,10 +188,18 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
} else {
parameters_map["export_lights"] = false;
}
- if (p_options.has(SNAME("blender/meshes/colors")) && p_options[SNAME("blender/meshes/colors")]) {
- parameters_map["export_colors"] = true;
+ if (blender_major_version > 4 || (blender_major_version == 4 && blender_minor_version >= 2)) {
+ if (p_options.has(SNAME("blender/meshes/colors")) && p_options[SNAME("blender/meshes/colors")]) {
+ parameters_map["export_vertex_color"] = "MATERIAL";
+ } else {
+ parameters_map["export_vertex_color"] = "NONE";
+ }
} else {
- parameters_map["export_colors"] = false;
+ if (p_options.has(SNAME("blender/meshes/colors")) && p_options[SNAME("blender/meshes/colors")]) {
+ parameters_map["export_colors"] = true;
+ } else {
+ parameters_map["export_colors"] = false;
+ }
}
if (p_options.has(SNAME("blender/nodes/visible"))) {
int32_t visible = p_options["blender/nodes/visible"];