mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Added check to see if a SceneNode has vertices before adding it
CURA-2460
This commit is contained in:
parent
3f9024aeff
commit
efd3fc3487
1 changed files with 7 additions and 2 deletions
|
@ -74,7 +74,12 @@ class ThreeMFReader(MeshReader):
|
||||||
# TODO: We currently do not check for normals and simply recalculate them.
|
# TODO: We currently do not check for normals and simply recalculate them.
|
||||||
mesh_builder.calculateNormals()
|
mesh_builder.calculateNormals()
|
||||||
mesh_builder.setFileName(file_name)
|
mesh_builder.setFileName(file_name)
|
||||||
node.setMeshData(mesh_builder.build().getTransformed(rotation))
|
mesh_data = mesh_builder.build().getTransformed(rotation)
|
||||||
|
|
||||||
|
if not len(mesh_data.getVertices()):
|
||||||
|
continue # This object doesn't have data, so skip it.
|
||||||
|
|
||||||
|
node.setMeshData(mesh_data)
|
||||||
node.setSelectable(True)
|
node.setSelectable(True)
|
||||||
|
|
||||||
transformations = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(entry.get("id")), self._namespaces)
|
transformations = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(entry.get("id")), self._namespaces)
|
||||||
|
@ -107,7 +112,7 @@ class ThreeMFReader(MeshReader):
|
||||||
node.setTransformation(temp_mat)
|
node.setTransformation(temp_mat)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node.getBoundingBox() # Selftest - There might be more functions that should fail
|
node.getBoundingBox() # Selftest - There might be more functions that should fail
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue