Merge pull request #77042 from dioptryk/obj-vertex-colors-master

Add support for non-standard OBJ vertex entries
This commit is contained in:
Rémi Verschelde 2023-05-15 09:34:59 +02:00
commit e2f27a2248
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -267,7 +267,7 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_
vtx.z = v[3].to_float() * scale_mesh.z + offset_mesh.z; vtx.z = v[3].to_float() * scale_mesh.z + offset_mesh.z;
vertices.push_back(vtx); vertices.push_back(vtx);
//vertex color //vertex color
if (v.size() == 7) { if (v.size() >= 7) {
while (colors.size() < vertices.size() - 1) { while (colors.size() < vertices.size() - 1) {
colors.push_back(Color(1.0, 1.0, 1.0)); colors.push_back(Color(1.0, 1.0, 1.0));
} }