Fix per vertex normals and colors import #6

Merged
Cedric Steiert merged 10 commits from Hombre57/io_scene_x3d:per-vertex_normals_and_colors into main 2024-08-07 12:04:13 +02:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 6007d1651d - Show all commits

View File

@ -1,7 +1,7 @@
schema_version = "1.0.0"
id = "web3d_x3d_vrml2_format"
name = "Web3D X3D/VRML2 format"
version = "2.3.3"
version = "2.3.4"
tagline = "Import-Export X3D, Import VRML2"
maintainer = "Community"
type = "add-on"

View File

@ -1997,6 +1997,12 @@ def importMesh_IndexedFaceSet(geom, ancestry):
for j in f
for cco in rgb[color_index[i]]]
bpymesh.vertex_colors.new().data.foreach_set('color', cco) # deprecated
elif len(faces) > len(rgb): # Static color per face without index, when all faces have the same color.
# Exported from SOLIDWORKS, see: `blender/blender-addons#105398`.
cco = [cco for (i, f) in enumerate(faces)
for j in f
for cco in rgb[0]]
bpymesh.vertex_colors.new().data.foreach_set('color', cco) # deprecated
else: # Color per face without index
cco = [cco for (i, f) in enumerate(faces)
for j in f