mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 23:15:52 +08:00
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:
parent
1e155662d9
commit
6256bf3a4d
@ -51,6 +51,10 @@ class ThreeMFReader(MeshReader):
|
|||||||
self._root = None
|
self._root = None
|
||||||
self._base_name = ""
|
self._base_name = ""
|
||||||
self._unit = None
|
self._unit = None
|
||||||
|
self._empty_project = False
|
||||||
|
|
||||||
|
def emptyFileHintSet(self) -> bool:
|
||||||
|
return self._empty_project
|
||||||
|
|
||||||
def _createMatrixFromTransformationString(self, transformation: str) -> Matrix:
|
def _createMatrixFromTransformationString(self, transformation: str) -> Matrix:
|
||||||
if transformation == "":
|
if transformation == "":
|
||||||
@ -257,6 +261,9 @@ class ThreeMFReader(MeshReader):
|
|||||||
|
|
||||||
result.append(um_node)
|
result.append(um_node)
|
||||||
|
|
||||||
|
if len(result) == 0:
|
||||||
|
self._empty_project = True
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
Logger.logException("e", "An exception occurred in 3mf reader.")
|
Logger.logException("e", "An exception occurred in 3mf reader.")
|
||||||
return []
|
return []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user