Fix per vertex normals and colors import #6
@ -1959,6 +1959,7 @@ def importMesh_IndexedFaceSet(geom, ancestry):
|
||||
co = [co for f in processPerVertexIndex(normal_index)
|
||||
for v in f
|
||||
for co in vectors[v]]
|
||||
bpymesh.vertices.foreach_set("normal", co)
|
||||
|
||||
# Mesh must be validated before assigning normals, but validation might
|
||||
# reorder corners. We must store normals in a temporary attribute
|
||||
@ -2063,7 +2064,8 @@ def importMesh_IndexedFaceSet(geom, ancestry):
|
||||
if colors and color_per_vertex:
|
||||
cco2 = [0.0 for x in range(int(len(bpymesh.attributes["temp_custom_colors"].data)*4))]
|
||||
bpymesh.attributes["temp_custom_colors"].data.foreach_get("color", cco2)
|
||||
bpymesh.color_attributes["Col"].data.foreach_set("color", cco2)
|
||||
bpymesh.color_attributes.new('ColorPerCoin', 'FLOAT_COLOR', 'CORNER')
|
||||
bpymesh.color_attributes["ColorPerCoin"].data.foreach_set("color", cco2)
|
||||
bpymesh.attributes.remove(bpymesh.attributes["temp_custom_colors"])
|
||||
|
||||
bpymesh.update()
|
||||
|
Loading…
Reference in New Issue
Block a user