From f82753b766fafcdf2e082a2c20e5bc2dd5a9a6f6 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Tue, 2 Jan 2018 09:39:20 +0000 Subject: [PATCH 1/4] Move optimize_wall_printing_order from experimental section to shell. Still not enabled by default yet but perhaps in the future after it has been tested more it will be. --- resources/definitions/fdmprinter.def.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 17f8b6826f..141bb48f18 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1168,6 +1168,14 @@ "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true }, + "optimize_wall_printing_order": + { + "label": "Optimize Wall Printing Order", + "description": "Optimize the order in which walls are printed so as to reduce the number of retractions and the distance travelled. Most parts will benefit from this being enabled but some may actually take longer so please compare the print time estimates with and without optimization.", + "type": "bool", + "default_value": false, + "settable_per_mesh": true + }, "outer_inset_first": { "label": "Outer Before Inner Walls", @@ -5216,14 +5224,6 @@ "description": "experimental!", "children": { - "optimize_wall_printing_order": - { - "label": "Optimize Wall Printing Order", - "description": "Optimize the order in which walls are printed so as to reduce the number of retractions and the distance travelled. Most parts will benefit from this being enabled but some may actually take longer so please compare the print time estimates with and without optimization.", - "type": "bool", - "default_value": false, - "settable_per_mesh": true - }, "support_skip_some_zags": { "label": "Break Up Support In Chunks", From 1796a182fac58692ef52c4bb3082dfd80fe61c9f Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 18 Jan 2018 11:54:30 +0100 Subject: [PATCH 2/4] CURA-4525 fix crashing cura due to empty build plate --- .../UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py index 9289981d64..548a350a57 100644 --- a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py @@ -286,7 +286,10 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte gcode_list = getattr(Application.getInstance().getController().getScene(), "gcode_dict")[output_build_plate_number] if not gcode_list: # Empty build plate Logger.log("d", "Skipping empty job (build plate number %d).", output_build_plate_number) - return self.sendPrintJob() + if self._job_list: + return self.sendPrintJob() + else: + return self._send_gcode_start = time.time() Logger.log("d", "Sending print job [%s] to host, build plate [%s]..." % (file_name, output_build_plate_number)) From 322420092dabd3cc0cdb59cebac20f31c96ff809 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 18 Jan 2018 13:47:50 +0100 Subject: [PATCH 3/4] Fix extruder handling in project loading CURA-4824 When a machine is getting overriden, it should not try to create the ExtruderStack for the single-extrusion machine loaded from the project file, otherwise that ExtruderStack will become an extra one. --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 77a7da8b6a..913cea4f26 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -24,6 +24,7 @@ from cura.Settings.ExtruderStack import ExtruderStack from cura.Settings.GlobalStack import GlobalStack from cura.Settings.CuraContainerStack import _ContainerIndexes from cura.QualityManager import QualityManager +from cura.CuraApplication import CuraApplication from configparser import ConfigParser import zipfile @@ -750,8 +751,16 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # If not extruder stacks were saved in the project file (pre 3.1) create one manually # We re-use the container registry's addExtruderStackForSingleExtrusionMachine method for this if not extruder_stacks: - stack = self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder") + if self._resolve_strategies["machine"] == "new": + stack = self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder") + else: + stack = global_stack.extruders.get("0") + if not stack: + # this should not happen + Logger.log("e", "Cannot find any extruder in an existing global stack [%s].", global_stack.getId()) if stack: + if global_stack.quality.getId() in ("empty", "empty_quality"): + stack.quality = empty_quality_container if self._resolve_strategies["machine"] == "override": # in case the extruder is newly created (for a single-extrusion machine), we need to override # the existing extruder stack. @@ -991,6 +1000,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): for stack in extruder_stacks: stack.setNextStack(global_stack) stack.containersChanged.emit(stack.getTop()) + else: + if quality_has_been_changed: + CuraApplication.getInstance().getMachineManager().activeQualityChanged.emit() # Actually change the active machine. Application.getInstance().setGlobalContainerStack(global_stack) @@ -1040,13 +1052,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # find the old material ID old_material_id_in_stack = stack.material.getId() best_matching_old_material_id = None - best_matching_old_meterial_prefix_length = -1 + best_matching_old_material_prefix_length = -1 for old_parent_material_id in old_new_material_dict: - if len(old_parent_material_id) < best_matching_old_meterial_prefix_length: + if len(old_parent_material_id) < best_matching_old_material_prefix_length: continue if len(old_parent_material_id) <= len(old_material_id_in_stack): if old_parent_material_id == old_material_id_in_stack[0:len(old_parent_material_id)]: - best_matching_old_meterial_prefix_length = len(old_parent_material_id) + best_matching_old_material_prefix_length = len(old_parent_material_id) best_matching_old_material_id = old_parent_material_id if best_matching_old_material_id is None: From ece63bfea8231411ef63e64623f3b666df42f66c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 18 Jan 2018 15:47:01 +0100 Subject: [PATCH 4/4] CURA-4821 The previous cached layer data is removed when a GCode is loaded. Temporary solution for one buildplate. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 9713211ad3..85699ea0f5 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -426,6 +426,13 @@ class CuraEngineBackend(QObject, Backend): if not isinstance(source, SceneNode): return + # This case checks if the source node is a node that contains a GCode. In this case the + # cached layer data is removed so the previous data is not rendered - CURA-4821 + if source.callDecoration("isBlockSlicing") and source.callDecoration("getLayerData"): + if self._stored_optimized_layer_data: + print(self._stored_optimized_layer_data) + del self._stored_optimized_layer_data[source.callDecoration("getBuildPlateNumber")] + build_plate_changed = set() source_build_plate_number = source.callDecoration("getBuildPlateNumber") if source == self._scene.getRoot():