diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-17 11:53:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-17 11:53:30 +0300 |
commit | 8c45db2066165ef32a565710d0188b85026fe1d1 (patch) | |
tree | 548e4c73ecf627cc42ab035be242774e28569a59 /io_mesh_ply | |
parent | 6afae5b4ca977a2555e95bb2469a58fb024beefd (diff) |
fix for vertex color import, 0.0 - 1.0, not 0 - 255.
Diffstat (limited to 'io_mesh_ply')
-rw-r--r-- | io_mesh_ply/import_ply.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index 6de90b1e..ade732b2 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -254,7 +254,7 @@ def load_ply(filepath): if uvindices: mesh_uvs.append([(vertices[index][uvindices[0]], 1.0 - vertices[index][uvindices[1]]) for index in indices]) if colindices: - mesh_colors.append([(vertices[index][colindices[0]], vertices[index][colindices[1]], vertices[index][colindices[2]]) for index in indices]) + mesh_colors.append([(vertices[index][colindices[0]] / 255.0, vertices[index][colindices[1]] / 255.0, vertices[index][colindices[2]] / 255.0) for index in indices]) if uvindices or colindices: # If we have Cols or UVs then we need to check the face order. @@ -309,11 +309,10 @@ def load_ply(filepath): uv[:] = ply_uv[j] if colindices: - faces = obj['face'] for i, f in enumerate(vcol_lay.data): # XXX, colors dont come in right, needs further investigation. ply_col = mesh_colors[i] - if len(faces[i]) == 4: + if len(ply_col) == 4: f_col = f.color1, f.color2, f.color3, f.color4 else: f_col = f.color1, f.color2, f.color3 |