mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 19:39:03 +08:00
Fixed crash when no transformation was provided in 3mf file
This commit is contained in:
parent
cfe538c4b7
commit
102b2e7fa0
@ -50,6 +50,7 @@ class ThreeMFReader(MeshReader):
|
|||||||
node.setSelectable(True)
|
node.setSelectable(True)
|
||||||
# Magical python comprehension; looks for the matching transformation
|
# Magical python comprehension; looks for the matching transformation
|
||||||
transformation = next((x for x in root.model.build.item if x["objectid"] == object["id"]), None)
|
transformation = next((x for x in root.model.build.item if x["objectid"] == object["id"]), None)
|
||||||
|
if transformation["transform"]:
|
||||||
splitted_transformation = transformation["transform"].split()
|
splitted_transformation = transformation["transform"].split()
|
||||||
|
|
||||||
## Transformation is saved as:
|
## Transformation is saved as:
|
||||||
@ -95,9 +96,12 @@ class ThreeMFReader(MeshReader):
|
|||||||
result.addChild(node)
|
result.addChild(node)
|
||||||
|
|
||||||
# If there is more then one object, group them.
|
# If there is more then one object, group them.
|
||||||
|
try:
|
||||||
if len(root.model.resources.object) > 1:
|
if len(root.model.resources.object) > 1:
|
||||||
group_decorator = GroupDecorator()
|
group_decorator = GroupDecorator()
|
||||||
result.addDecorator(group_decorator)
|
result.addDecorator(group_decorator)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("EXCEPTION: " ,e)
|
print("EXCEPTION: " ,e)
|
||||||
return result
|
return result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user