mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 16:57:51 -06:00
Corrections in plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py
* Remove unused import * Replace dict with dictionary in comment * Use object_position instead of i * Use current_object instead of object which is a built-in class
This commit is contained in:
parent
d1f5985fee
commit
74627345a2
1 changed files with 6 additions and 7 deletions
|
@ -16,7 +16,6 @@ from cura import LayerData
|
||||||
from cura import LayerDataDecorator
|
from cura import LayerDataDecorator
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
import struct
|
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ class ProcessSlicedObjectListJob(Job):
|
||||||
|
|
||||||
object_id_map = {}
|
object_id_map = {}
|
||||||
new_node = SceneNode()
|
new_node = SceneNode()
|
||||||
## Put all nodes in a dict identified by ID
|
## Put all nodes in a dictionary identified by ID
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
if type(node) is SceneNode and node.getMeshData():
|
if type(node) is SceneNode and node.getMeshData():
|
||||||
if node.callDecoration("getLayerData"):
|
if node.callDecoration("getLayerData"):
|
||||||
|
@ -74,15 +73,15 @@ class ProcessSlicedObjectListJob(Job):
|
||||||
layer_count += self._message.getRepeatedMessage("objects", i).repeatedMessageCount("layers")
|
layer_count += self._message.getRepeatedMessage("objects", i).repeatedMessageCount("layers")
|
||||||
|
|
||||||
current_layer = 0
|
current_layer = 0
|
||||||
for i in range(self._message.repeatedMessageCount("objects")):
|
for object_position in range(self._message.repeatedMessageCount("objects")):
|
||||||
object = self._message.getRepeatedMessage("objects", i)
|
current_object = self._message.getRepeatedMessage("objects", object_position)
|
||||||
try:
|
try:
|
||||||
node = object_id_map[object.id]
|
node = object_id_map[current_object.id]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for l in range(object.repeatedMessageCount("layers")):
|
for l in range(current_object.repeatedMessageCount("layers")):
|
||||||
layer = object.getRepeatedMessage("layers", l)
|
layer = current_object.getRepeatedMessage("layers", l)
|
||||||
|
|
||||||
layer_data.addLayer(layer.id)
|
layer_data.addLayer(layer.id)
|
||||||
layer_data.setLayerHeight(layer.id, layer.height)
|
layer_data.setLayerHeight(layer.id, layer.height)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue