[Bf-extensions-cvs] [bb5ff2b] master: Fix for exporting meshes with vertex colors where not all vertices are being used by faces.

Seva Alekseyev noreply at git.blender.org
Mon Mar 7 18:53:28 CET 2016


Commit: bb5ff2b9d56af4fc6e52dbf8bdde1daec5717671
Author: Seva Alekseyev
Date:   Mon Mar 7 12:53:07 2016 -0500
Branches: master
https://developer.blender.org/rBAbb5ff2b9d56af4fc6e52dbf8bdde1daec5717671

Fix for exporting meshes with vertex colors where not all vertices are being used by faces.

===================================================================

M	io_scene_x3d/export_x3d.py

===================================================================

diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 4f9fecf..8129dc3 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -934,7 +934,7 @@ def export(file,
                             fw('%s<Color color="' % ident)
                             if is_col_per_vertex:
                                 for i in range(len(mesh.vertices)):
-                                    fw('%.3f %.3f %.3f ' % vert_color[i][:])
+                                    fw('%.3f %.3f %.3f ' % (vert_color[i][:] if i in vert_color else (0,0,0)))
                             else: # Export as colors per face. 
                                 # TODO: average them rather than using the first one!
                                 for i in face_group:



More information about the Bf-extensions-cvs mailing list