Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChrisTerBeke <c.terbeke@ultimaker.com>2017-09-28 17:00:16 +0300
committerChrisTerBeke <c.terbeke@ultimaker.com>2017-09-28 17:00:16 +0300
commit1b8766b953e88aac9e4b8d51732a601fc924757e (patch)
tree8da604f9ea406f705ce15a56c6566242025a132b /cura/Settings/ExtruderManager.py
parente3edc79a3ecd3cd4a5806b7133a0996367b8049e (diff)
CURA-4386 CURA-4379 change stack behaviours to fix crashes
Diffstat (limited to 'cura/Settings/ExtruderManager.py')
-rwxr-xr-xcura/Settings/ExtruderManager.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py
index b16a88f1a9..7a6537e7d2 100755
--- a/cura/Settings/ExtruderManager.py
+++ b/cura/Settings/ExtruderManager.py
@@ -41,7 +41,7 @@ class ExtruderManager(QObject):
def __init__(self, parent = None):
super().__init__(parent)
self._extruder_trains = { } #Per machine, a dictionary of extruder container stack IDs. Only for separately defined extruders.
- self._active_extruder_index = 0
+ self._active_extruder_index = -1
self._selected_object_extruders = []
Application.getInstance().globalContainerStackChanged.connect(self.__globalContainerStackChanged)
self._global_container_stack_definition_id = None
@@ -78,6 +78,7 @@ class ExtruderManager(QObject):
def extruderIds(self):
map = {}
global_stack_id = Application.getInstance().getGlobalContainerStack().getId()
+ map["-1"] = global_stack_id
if global_stack_id in self._extruder_trains:
for position in self._extruder_trains[global_stack_id]:
map[position] = self._extruder_trains[global_stack_id][position].getId()
@@ -513,11 +514,16 @@ class ExtruderManager(QObject):
global_stack = Application.getInstance().getGlobalContainerStack()
result = []
+ machine_extruder_count = global_stack.getProperty("machine_extruder_count", "value")
+
+ if machine_extruder_count is 1:
+ return result
+
if global_stack and global_stack.getId() in self._extruder_trains:
for extruder in sorted(self._extruder_trains[global_stack.getId()]):
result.append(self._extruder_trains[global_stack.getId()][extruder])
- return result[:global_stack.getProperty("machine_extruder_count", "value")]
+ return result[:machine_extruder_count]
def __globalContainerStackChanged(self) -> None:
global_container_stack = Application.getInstance().getGlobalContainerStack()