فهرست منبع

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

Geoffrey Irons 7 سال پیش
والد
کامیت
88a8803cd3
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  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", "", "")