fix list index out of range for color_per_vertex #2

Merged
Cedric Steiert merged 5 commits from Bujus_Krachus/io_scene_x3d:fix-list-index-out-of-range-vertex-color into main 2024-08-06 17:19:38 +02:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit b566bb6c87 - 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

@ -2001,6 +2001,11 @@ def importMesh_IndexedFaceSet(geom, ancestry):
cco = [cco for (i, f) in enumerate(faces)
for j in f
for cco in rgb[color_index[i]]]
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]]
else: # Color per face without index
cco = [cco for (i, f) in enumerate(faces)
for j in f