mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Remove unused imports and replace object with entry
"object" is also a built-in function of python
This commit is contained in:
parent
cbc7f0c1de
commit
2a104bc6da
1 changed files with 5 additions and 8 deletions
|
@ -12,10 +12,7 @@ from UM.Math.Quaternion import Quaternion
|
||||||
|
|
||||||
from UM.Job import Job
|
from UM.Job import Job
|
||||||
|
|
||||||
import os
|
|
||||||
import struct
|
|
||||||
import math
|
import math
|
||||||
from os import listdir
|
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
@ -44,16 +41,16 @@ class ThreeMFReader(MeshReader):
|
||||||
Logger.log("w", "No objects found in 3MF file %s, either the file is corrupt or you are using an outdated format", file_name)
|
Logger.log("w", "No objects found in 3MF file %s, either the file is corrupt or you are using an outdated format", file_name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for object in objects:
|
for entry in objects:
|
||||||
mesh = MeshData()
|
mesh = MeshData()
|
||||||
node = SceneNode()
|
node = SceneNode()
|
||||||
vertex_list = []
|
vertex_list = []
|
||||||
#for vertex in object.mesh.vertices.vertex:
|
#for vertex in entry.mesh.vertices.vertex:
|
||||||
for vertex in object.findall(".//3mf:vertex", self._namespaces):
|
for vertex in entry.findall(".//3mf:vertex", self._namespaces):
|
||||||
vertex_list.append([vertex.get("x"), vertex.get("y"), vertex.get("z")])
|
vertex_list.append([vertex.get("x"), vertex.get("y"), vertex.get("z")])
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
triangles = object.findall(".//3mf:triangle", self._namespaces)
|
triangles = entry.findall(".//3mf:triangle", self._namespaces)
|
||||||
|
|
||||||
mesh.reserveFaceCount(len(triangles))
|
mesh.reserveFaceCount(len(triangles))
|
||||||
|
|
||||||
|
@ -70,7 +67,7 @@ class ThreeMFReader(MeshReader):
|
||||||
node.setMeshData(mesh)
|
node.setMeshData(mesh)
|
||||||
node.setSelectable(True)
|
node.setSelectable(True)
|
||||||
|
|
||||||
transformation = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(object.get("id")), self._namespaces)
|
transformation = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(entry.get("id")), self._namespaces)
|
||||||
if transformation:
|
if transformation:
|
||||||
transformation = transformation[0]
|
transformation = transformation[0]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue