mirror of https://github.com/godotengine/godot
Update vertex color import to handle Blender 4.2 upwards
Blender commit 0f0a8df8a9 which is landing in 4.2 deprecated `vertex_colors` GLTF property, use `export_vertex_color` instead.
This commit is contained in:
parent
20ba2f00bd
commit
7864abbeec
|
|
@ -188,11 +188,19 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
|
||||||
} else {
|
} else {
|
||||||
parameters_map["export_lights"] = false;
|
parameters_map["export_lights"] = false;
|
||||||
}
|
}
|
||||||
|
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 {
|
||||||
if (p_options.has(SNAME("blender/meshes/colors")) && p_options[SNAME("blender/meshes/colors")]) {
|
if (p_options.has(SNAME("blender/meshes/colors")) && p_options[SNAME("blender/meshes/colors")]) {
|
||||||
parameters_map["export_colors"] = true;
|
parameters_map["export_colors"] = true;
|
||||||
} else {
|
} else {
|
||||||
parameters_map["export_colors"] = false;
|
parameters_map["export_colors"] = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (p_options.has(SNAME("blender/nodes/visible"))) {
|
if (p_options.has(SNAME("blender/nodes/visible"))) {
|
||||||
int32_t visible = p_options["blender/nodes/visible"];
|
int32_t visible = p_options["blender/nodes/visible"];
|
||||||
if (visible == BLEND_VISIBLE_VISIBLE_ONLY) {
|
if (visible == BLEND_VISIBLE_VISIBLE_ONLY) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue