From 14cf678fa958e564191d32ceefb2279821b4182a Mon Sep 17 00:00:00 2001 From: Cedric Steiert Date: Fri, 19 Jul 2024 20:22:00 +0200 Subject: [PATCH] fix https://projects.blender.org/blender/blender-addons/issues/105398 include case same color fixes https://projects.blender.org/blender/blender-addons/issues/105398, where objects from solidworks get an list index out of range error, when all faces have the same color attributes. --- source/import_x3d.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/import_x3d.py b/source/import_x3d.py index 4c21551..3c03696 100644 --- a/source/import_x3d.py +++ b/source/import_x3d.py @@ -1985,6 +1985,10 @@ 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 + 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 -- 2.30.2