add checks for NoneType to ignore empty shape nodes #3
@ -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
|
||||
@ -3142,6 +3146,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(
|
||||
|
Loading…
Reference in New Issue
Block a user