Possible to distinguish between empty and corrupt 3MF.

Otherwise the user could infer valid, but empty workspace is corrupt.

CURA-7996
This commit is contained in:
Remco Burema 2021-02-03 09:27:58 +01:00
parent 1e155662d9
commit 6256bf3a4d
No known key found for this signature in database
GPG key ID: 215C49431D43F98C

View file

@ -51,6 +51,10 @@ class ThreeMFReader(MeshReader):
self._root = None
self._base_name = ""
self._unit = None
self._empty_project = False
def emptyFileHintSet(self) -> bool:
return self._empty_project
def _createMatrixFromTransformationString(self, transformation: str) -> Matrix:
if transformation == "":
@ -257,6 +261,9 @@ class ThreeMFReader(MeshReader):
result.append(um_node)
if len(result) == 0:
self._empty_project = True
except Exception:
Logger.logException("e", "An exception occurred in 3mf reader.")
return []