Fail loading the 3MF file if no meshes were found

This way we indicate loading the 3MF file failed instead of indicating
success but not actually loading anything.

CURA-236
This commit is contained in:
Arjen Hiemstra 2015-10-13 18:42:01 +02:00
parent 3bbefd588b
commit 463fbae9aa

View File

@ -42,6 +42,10 @@ class ThreeMFReader(MeshReader):
# There can be multiple objects, try to load all of them.
objects = root.findall("./3mf:resources/3mf:object", self._namespaces)
if len(objects) == 0:
Logger.log("w", "No objects found in 3MF file %s, either the file is corrupt or you are using an outdated format", file_name)
return None
for object in objects:
mesh = MeshData()
node = SceneNode()