mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
CURA-4400 not sending objects that are printed with a disabled extruder
This commit is contained in:
parent
86c13e86c7
commit
f28bed9b4f
2 changed files with 20 additions and 7 deletions
|
@ -43,6 +43,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
|
||||
# The variant of the extruder.
|
||||
VariantRole = Qt.UserRole + 7
|
||||
StackRole = Qt.UserRole + 8
|
||||
|
||||
## List of colours to display if there is no material or the material has no known
|
||||
# colour.
|
||||
|
@ -62,6 +63,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
self.addRoleName(self.DefinitionRole, "definition")
|
||||
self.addRoleName(self.MaterialRole, "material")
|
||||
self.addRoleName(self.VariantRole, "variant")
|
||||
self.addRoleName(self.StackRole, "stack")
|
||||
|
||||
self._update_extruder_timer = QTimer()
|
||||
self._update_extruder_timer.setInterval(100)
|
||||
|
@ -188,6 +190,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||
"definition": extruder.getBottom().getId(),
|
||||
"material": extruder.material.getName() if extruder.material else "",
|
||||
"variant": extruder.variant.getName() if extruder.variant else "", # e.g. print core
|
||||
"stack": extruder,
|
||||
}
|
||||
|
||||
items.append(item)
|
||||
|
|
|
@ -110,6 +110,7 @@ class StartSliceJob(Job):
|
|||
return
|
||||
|
||||
stack = Application.getInstance().getGlobalContainerStack()
|
||||
extruder_stack_id_to_position = {} # a lookup table because we need the position, not the id.
|
||||
if not stack:
|
||||
self.setResult(StartJobResult.Error)
|
||||
return
|
||||
|
@ -129,7 +130,8 @@ class StartSliceJob(Job):
|
|||
self.setResult(StartJobResult.MaterialIncompatible)
|
||||
return
|
||||
|
||||
for extruder_stack in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||
for position, extruder_stack in stack.extruders.items():
|
||||
extruder_stack_id_to_position[extruder_stack.getId()] = position
|
||||
material = extruder_stack.findContainer({"type": "material"})
|
||||
if material:
|
||||
if material.getMetaDataEntry("compatible") == False:
|
||||
|
@ -193,8 +195,16 @@ class StartSliceJob(Job):
|
|||
if per_object_stack:
|
||||
is_non_printing_mesh = any(per_object_stack.getProperty(key, "value") for key in NON_PRINTING_MESH_SETTINGS)
|
||||
|
||||
if node.callDecoration("getBuildPlateNumber") == self._build_plate_number:
|
||||
if not getattr(node, "_outside_buildarea", False) or is_non_printing_mesh:
|
||||
# Find a reason not to add the node
|
||||
if node.callDecoration("getBuildPlateNumber") != self._build_plate_number:
|
||||
continue
|
||||
if getattr(node, "_outside_buildarea", False) and is_non_printing_mesh:
|
||||
continue
|
||||
node_extruder_id = node.callDecoration("getActiveExtruder")
|
||||
node_position = extruder_stack_id_to_position.get(node_extruder_id, "0")
|
||||
if not stack.extruders[str(node_position)].isEnabled:
|
||||
continue
|
||||
|
||||
temp_list.append(node)
|
||||
if not is_non_printing_mesh:
|
||||
has_printing_mesh = True
|
||||
|
@ -382,7 +392,7 @@ class StartSliceJob(Job):
|
|||
def _buildGlobalInheritsStackMessage(self, stack):
|
||||
for key in stack.getAllKeys():
|
||||
extruder = int(round(float(stack.getProperty(key, "limit_to_extruder"))))
|
||||
if extruder >= 0: #Set to a specific extruder.
|
||||
if extruder >= 0 and stack.extruders[str(extruder)].isEnabled: #Set to a specific extruder.
|
||||
setting_extruder = self._slice_message.addRepeatedMessage("limit_to_extruder")
|
||||
setting_extruder.name = key
|
||||
setting_extruder.extruder = extruder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue