diff --git a/source/import_x3d.py b/source/import_x3d.py index a3e1202..2b18b77 100644 --- a/source/import_x3d.py +++ b/source/import_x3d.py @@ -1878,6 +1878,10 @@ def importMesh_IndexedFaceSet(geom, ancestry): ccw = geom.getFieldAsBool('ccw', True, ancestry) coord = geom.getChildBySpec('Coordinate') + + if coord is None: + return None + if coord.reference: points = coord.getRealNode().parsed # We need unflattened coord array here, while @@ -3163,6 +3167,10 @@ def importShape(bpycollection, node, ancestry, global_matrix): if geom_fn is not None: bpydata = geom_fn(geom, ancestry) + if bpydata is None: + print('ImportX3D warning: empty shape, skipping node "%s"' % vrmlname) + return + # There are no geometry importers that can legally return # no object. It's either a bpy object, or an exception importShape_ProcessObject(