From 0bc9da6ae12b4e0d3ba44fb2bb1bbcd3902d3409 Mon Sep 17 00:00:00 2001 From: Cedric Steiert Date: Mon, 22 Jul 2024 03:29:10 +0200 Subject: [PATCH] X3D/VRML import: Fix blender/blender-addons#98442, check if USE-based cache is set in IndexedFaceSet Ported https://projects.blender.org/blender/blender-addons/pulls/104596 to new repository: Some X3D/VRML files would fail to import due to the code in importMesh_IndexedFaceSet not checking whether the USE-based cache was actually initialized before using it. This PR adds that check. Fixes https://projects.blender.org/blender/blender-addons/issues/98442 original comitter: @uh-wot --- source/import_x3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/import_x3d.py b/source/import_x3d.py index 4c21551..028245e 100644 --- a/source/import_x3d.py +++ b/source/import_x3d.py @@ -1878,7 +1878,7 @@ def importMesh_IndexedFaceSet(geom, ancestry): ccw = geom.getFieldAsBool('ccw', True, ancestry) coord = geom.getChildBySpec('Coordinate') - if coord.reference: + if coord.reference and coord.getRealNode().parsed: points = coord.getRealNode().parsed # We need unflattened coord array here, while # importMesh_ReadVertices uses flattened. Can't cache both :( -- 2.30.2