chiark / gitweb /
Do not reuse an argument variable as iterator
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 4 May 2015 20:18:03 +0000 (16:18 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Mon, 4 May 2015 20:18:03 +0000 (16:18 -0400)
This caused issues with the head/gantry size when printing one object
at a time. The obj variable would never be None at the end of the function
which means it wasn't updating all objects with the gantry size, only the
last object iterated on, which caused the objects to think there are no
collisions between them when printing order was being decided.
This should hopefully fix issue #104

Cura/util/objectScene.py

index 18850a6244783866bd05759b00956cc70bf02ba8..d29ded10c4b5aa8daa3d1523e11e643c2029b5a8 100644 (file)
@@ -173,8 +173,8 @@ class Scene(object):
                                #print mode was changed by user. We need to reset that value to test with current scene content
                                self._lastResultOneAtATime = True
 
-                       for obj in self._objectList:
-                               if obj.getSize()[2] - objectSink > self._gantryHeight:
+                       for objIter in self._objectList:
+                               if objIter.getSize()[2] - objectSink > self._gantryHeight:
                                        self._oneAtATime = False
                                        if self._lastResultOneAtATime:
                                                if self._sceneView: