Fix error adding typed text annotations #5300

Apparently it's part of #4832, previously creating a shape for IfcTypeProduct with literals would error, we ignored the error and type product end up being an empty. After 0.8.0 create_shape for literals creates an empty shape (0 verts) and we need to skip it, otherwise there would be an empty mesh representaiton.
This commit is contained in:
Andrej730
2024-09-09 12:11:04 +05:00
parent a3c5c334f1
commit 6da7e18f50
+4 -1
View File
@@ -570,7 +570,10 @@ class IfcImporter:
mesh = self.meshes.get(mesh_name)
if mesh is None:
shape = tool.Loader.create_generic_shape(representation)
if shape:
# Skip elements without geometry - e.g. annotations with IfcTextLiterals.
if shape and not shape.verts_buffer:
pass
elif shape:
mesh = self.create_mesh(element, shape)
tool.Loader.link_mesh(shape, mesh)
self.meshes[mesh_name] = mesh