Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix OBJ importer ignoring vertex color alpha channel

imdongye712cba0ff6cd
diff --git a/editor/import/3d/resource_importer_obj.cpp b/editor/import/3d/resource_importer_obj.cpp
index 7c57e8dd170..e7f177560e4 100644
--- a/editor/import/3d/resource_importer_obj.cpp
+++ b/editor/import/3d/resource_importer_obj.cpp
@@ -292,6 +292,9 @@ static Error _parse_obj(const String &p_path, List<Ref<ImporterMesh>> &r_meshes,
c.r = v[4].to_float();
c.g = v[5].to_float();
c.b = v[6].to_float();
+ if (v.size() >= 8) {
+ c.a = v[7].to_float();
+ }
colors.push_back(c);
} else if (!colors.is_empty()) {
colors.push_back(Color(1.0, 1.0, 1.0));