fix list index out of range for color_per_vertex #2
@ -1975,12 +1975,19 @@ def importMesh_IndexedFaceSet(geom, ancestry):
|
||||
|
||||
color_per_vertex = geom.getFieldAsBool('colorPerVertex', True, ancestry)
|
||||
color_index = geom.getFieldAsArray('colorIndex', 0, ancestry)
|
||||
has_color_index = len(color_index) >= len(index)
|
||||
# TODO: check color index for -1 values and rebuild if not existent
|
||||
|
||||
d = bpymesh.vertex_colors.new().data
|
||||
if color_per_vertex:
|
||||
|
||||
if color_per_vertex and has_color_index: # Color per vertex with index
|
||||
cco = [cco for f in processPerVertexIndex(color_index)
|
||||
for (i, v) in enumerate(f)
|
||||
for cco in rgb[i]]
|
||||
for v in f
|
||||
for cco in rgb[v]]
|
||||
elif color_per_vertex: # Color per vertex without index
|
||||
cco = [cco for f in processPerVertexIndex(color_index)
|
||||
for (i, v) in enumerate(f)
|
||||
for cco in rgb[i]]
|
||||
elif color_index: # Color per face with index
|
||||
cco = [cco for (i, f) in enumerate(faces)
|
||||
for j in f
|
||||
|
Loading…
Reference in New Issue
Block a user