mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +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)
|
||||
# Magical python comprehension; looks for the matching transformation
|
||||
transformation = next((x for x in root.model.build.item if x["objectid"] == object["id"]), None)
|
||||
if transformation["transform"]:
|
||||
splitted_transformation = transformation["transform"].split()
|
||||
|
||||
## Transformation is saved as:
|
||||
@ -95,9 +96,12 @@ class ThreeMFReader(MeshReader):
|
||||
result.addChild(node)
|
||||
|
||||
# If there is more then one object, group them.
|
||||
try:
|
||||
if len(root.model.resources.object) > 1:
|
||||
group_decorator = GroupDecorator()
|
||||
result.addDecorator(group_decorator)
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print("EXCEPTION: " ,e)
|
||||
return result
|
||||
|
Loading…
x
Reference in New Issue
Block a user