Browse Source

Fix issue with new versions of blender vertex colors using RGBA, older ones have just RGB.

Geoffrey Irons 7 years ago
parent
commit
88a8803cd3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      io_scene_godot/converters/mesh.py

+ 4 - 1
io_scene_godot/converters/mesh.py

@@ -258,7 +258,10 @@ class Surface:
         if has_colors:
             color_vals = Array("ColorArray(")
             for vert in self.vertices:
-                color_vals.extend(list(vert.color)+[1.0])
+                col = list(vert.color)
+                if len(col) == 3:
+                    col += [1.0]
+                color_vals.extend(col)
         else:
             color_vals = Array("null, ; no Vertex Colors", "", "")