mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-07 07:01:49 +08:00
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:
parent
3bbefd588b
commit
463fbae9aa
@ -42,6 +42,10 @@ class ThreeMFReader(MeshReader):
|
|||||||
|
|
||||||
# There can be multiple objects, try to load all of them.
|
# There can be multiple objects, try to load all of them.
|
||||||
objects = root.findall("./3mf:resources/3mf:object", self._namespaces)
|
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:
|
for object in objects:
|
||||||
mesh = MeshData()
|
mesh = MeshData()
|
||||||
node = SceneNode()
|
node = SceneNode()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user