mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fixed crash when no transformation was provided in 3mf file
This commit is contained in:
parent
cfe538c4b7
commit
102b2e7fa0
1 changed files with 49 additions and 45 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue