Commit: 4ed7bc28930fc3765be57737936bb4a15f0b9840
Author: Darshan Kadu
Date:   Tue Jul 18 23:41:56 2017 +0530
Branches: soc-2017-vertex_paint
https://developer.blender.org/rB4ed7bc28930fc3765be57737936bb4a15f0b9840

modified the ply importer to take alpha in vpaint

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

M       release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py

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

diff --git a/release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py 
b/release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py
index 76e5ff1e025..ea8a8ac7854 100644
--- a/release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py
+++ b/release/scripts/startup/io_mesh_ply_soc/import_ply_soc.py
@@ -236,7 +236,7 @@ def load_ply_mesh(filepath, ply_name):
             uvindices = (el.index(b's'), el.index(b't'))
             if -1 in uvindices:
                 uvindices = None
-            colindices = el.index(b'red'), el.index(b'green'), 
el.index(b'blue')
+            colindices = el.index(b'red'), el.index(b'green'), 
el.index(b'blue'), el.index(b'alpha')
             if -1 in colindices:
                 colindices = None
             else:  # if not a float assume uchar
@@ -261,6 +261,7 @@ def load_ply_mesh(filepath, ply_name):
             mesh_colors.append([(vertices[index][colindices[0]] * 
colmultiply[0],
                                  vertices[index][colindices[1]] * 
colmultiply[1],
                                  vertices[index][colindices[2]] * 
colmultiply[2],
+                                 vertices[index][colindices[3]] * 
colmultiply[3],
                                  ) for index in indices])
 
     if uvindices or colindices:
@@ -334,7 +335,11 @@ def load_ply_mesh(filepath, ply_name):
                         f_col = f.color1, f.color2, f.color3
 
                     for j, col in enumerate(f_col):
-                        col.r, col.g, col.b = ply_col[j]
+                        col[0] = ply_col[j][0]
+                        col[1] = ply_col[j][1]
+                        col[2] = ply_col[j][2]
+                        col[3] = ply_col[j][3]
+
 
     mesh.validate()
     mesh.update()

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to