From 4940f3b88baa5ec579cccb68d4beb80074b16dc1 Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 16 Mar 2018 14:39:01 +0100 Subject: [PATCH 1/7] Retraction minimum travel update Changed it to 2 or 3 times line width, similar as with the 0.4mm profiles. Was 5mm standard for all profiles with the 0.8mm printcore, except TPU. --- resources/variants/ultimaker3_aa0.8.inst.cfg | 1 + resources/variants/ultimaker3_bb0.8.inst.cfg | 2 +- resources/variants/ultimaker3_extended_aa0.8.inst.cfg | 1 + resources/variants/ultimaker3_extended_bb0.8.inst.cfg | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/variants/ultimaker3_aa0.8.inst.cfg b/resources/variants/ultimaker3_aa0.8.inst.cfg index 0bccf91b7c..97ee3587cf 100644 --- a/resources/variants/ultimaker3_aa0.8.inst.cfg +++ b/resources/variants/ultimaker3_aa0.8.inst.cfg @@ -46,6 +46,7 @@ retraction_count_max = 25 retraction_extrusion_window = 1 retraction_hop = 2 retraction_hop_only_when_collides = True +retraction_min_travel = =line_width * 2 skin_overlap = 5 speed_equalize_flow_enabled = True speed_layer_0 = 20 diff --git a/resources/variants/ultimaker3_bb0.8.inst.cfg b/resources/variants/ultimaker3_bb0.8.inst.cfg index 41c6419ec1..828e3f35fe 100644 --- a/resources/variants/ultimaker3_bb0.8.inst.cfg +++ b/resources/variants/ultimaker3_bb0.8.inst.cfg @@ -58,7 +58,7 @@ retraction_extrusion_window = =retraction_amount retraction_hop = 2 retraction_hop_enabled = True retraction_hop_only_when_collides = True -retraction_min_travel = 5 +retraction_min_travel = =line_width * 3 retraction_prime_speed = 15 skin_overlap = 5 speed_layer_0 = 20 diff --git a/resources/variants/ultimaker3_extended_aa0.8.inst.cfg b/resources/variants/ultimaker3_extended_aa0.8.inst.cfg index 184416b06e..149b832514 100644 --- a/resources/variants/ultimaker3_extended_aa0.8.inst.cfg +++ b/resources/variants/ultimaker3_extended_aa0.8.inst.cfg @@ -46,6 +46,7 @@ retraction_count_max = 25 retraction_extrusion_window = 1 retraction_hop = 2 retraction_hop_only_when_collides = True +retraction_min_travel = =line_width * 2 skin_overlap = 5 speed_equalize_flow_enabled = True speed_layer_0 = 20 diff --git a/resources/variants/ultimaker3_extended_bb0.8.inst.cfg b/resources/variants/ultimaker3_extended_bb0.8.inst.cfg index 8a1a9373f3..541034f119 100644 --- a/resources/variants/ultimaker3_extended_bb0.8.inst.cfg +++ b/resources/variants/ultimaker3_extended_bb0.8.inst.cfg @@ -57,7 +57,7 @@ retraction_count_max = 15 retraction_extrusion_window = =retraction_amount retraction_hop = 2 retraction_hop_only_when_collides = True -retraction_min_travel = 5 +retraction_min_travel = =line_width * 3 retraction_prime_speed = 15 skin_overlap = 5 speed_layer_0 = 20 From bd775cf32eeaf328a4bdf7ca319393c0cd43bb4c Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Mon, 19 Mar 2018 10:56:40 +0100 Subject: [PATCH 2/7] CURA-4400 fix support_extruder_nr values in overhang angle and SliceInfo --- cura/Scene/CuraSceneNode.py | 2 +- cura/Settings/CuraContainerStack.py | 8 ++++++++ plugins/SliceInfoPlugin/SliceInfo.py | 4 ++-- plugins/SolidView/SolidView.py | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index b29108d636..48d271a2f2 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -41,7 +41,7 @@ class CuraSceneNode(SceneNode): # Use the support extruder instead of the active extruder if this is a support_mesh if per_mesh_stack: if per_mesh_stack.getProperty("support_mesh", "value"): - return extruders[int(global_container_stack.getProperty("support_extruder_nr", "value"))] + return extruders[int(global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr"))] # It's only set if you explicitly choose an extruder extruder_id = self.callDecoration("getActiveExtruder") diff --git a/cura/Settings/CuraContainerStack.py b/cura/Settings/CuraContainerStack.py index 00db4f57c7..ca4f866598 100755 --- a/cura/Settings/CuraContainerStack.py +++ b/cura/Settings/CuraContainerStack.py @@ -8,6 +8,7 @@ from typing import Any, Optional from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject from UM.FlameProfiler import pyqtSlot +from UM.Application import Application from UM.Decorators import override from UM.Logger import Logger from UM.Settings.ContainerStack import ContainerStack, InvalidContainerStackError @@ -314,6 +315,13 @@ class CuraContainerStack(ContainerStack): return cls._findInstanceContainerDefinitionId(definitions[0]) + ## getProperty for extruder positions, with translation from -1 to default extruder number + def getExtruderPositionValueWithDefault(self, key): + value = self.getProperty(key, "value") + if value == -1: + value = int(Application.getInstance().getMachineManager().defaultExtruderPosition) + return value + ## private: # Private helper class to keep track of container positions and their types. diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 971a324aa2..e1c990c596 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -146,7 +146,7 @@ class SliceInfo(Extension): model_stack = node.callDecoration("getStack") if model_stack: model_settings["support_enabled"] = model_stack.getProperty("support_enable", "value") - model_settings["support_extruder_nr"] = int(model_stack.getProperty("support_extruder_nr", "value")) + model_settings["support_extruder_nr"] = int(model_stack.getExtruderPositionValueWithDefault("support_extruder_nr")) # Mesh modifiers; model_settings["infill_mesh"] = model_stack.getProperty("infill_mesh", "value") @@ -177,7 +177,7 @@ class SliceInfo(Extension): # Support settings print_settings["support_enabled"] = global_container_stack.getProperty("support_enable", "value") - print_settings["support_extruder_nr"] = int(global_container_stack.getProperty("support_extruder_nr", "value")) + print_settings["support_extruder_nr"] = int(global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr")) # Platform adhesion settings print_settings["adhesion_type"] = global_container_stack.getProperty("adhesion_type", "value") diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index de9f922267..ff5aab96d2 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -62,7 +62,7 @@ class SolidView(View): global_container_stack = Application.getInstance().getGlobalContainerStack() if global_container_stack: - support_extruder_nr = global_container_stack.getProperty("support_extruder_nr", "value") + support_extruder_nr = global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr") support_angle_stack = Application.getInstance().getExtruderManager().getExtruderStack(support_extruder_nr) if support_angle_stack is not None and Preferences.getInstance().getValue("view/show_overhang"): @@ -89,7 +89,7 @@ class SolidView(View): # Use the support extruder instead of the active extruder if this is a support_mesh if per_mesh_stack: if per_mesh_stack.getProperty("support_mesh", "value"): - extruder_index = int(global_container_stack.getProperty("support_extruder_nr", "value")) + extruder_index = int(global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr")) try: material_color = self._extruders_model.getItem(extruder_index)["color"] From 2660d158570e44958aee278f5e8699f7bf8023d2 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 19 Mar 2018 10:42:46 +0100 Subject: [PATCH 3/7] Make "show all settings" work CURA-5088 "Show All Settings" in setting visibility menu now sets all settings to be visible. --- .../Menus/SettingVisibilityPresetsMenu.qml | 5 +--- .../qml/Preferences/SettingVisibilityPage.qml | 4 +-- resources/qml/Settings/SettingView.qml | 29 ++++--------------- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml index 0753c83b17..47f8846050 100644 --- a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml +++ b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml @@ -13,11 +13,8 @@ Menu title: catalog.i18nc("@action:inmenu", "Visible Settings") property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() - property bool showingSearchResults - property bool showingAllSettings signal showAllSettings() - signal showSettingVisibilityProfile() Instantiator { @@ -43,7 +40,7 @@ Menu MenuSeparator {} MenuItem { - text: catalog.i18nc("@action:inmenu", "All Settings") + text: catalog.i18nc("@action:inmenu", "Show All Settings") checkable: true checked: showingAllSettings exclusiveGroup: group diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index b6b1c133ed..d5ff57cb7c 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -72,11 +72,11 @@ UM.PreferencesPage { if(parent.checkedState == Qt.Unchecked || parent.checkedState == Qt.PartiallyChecked) { - definitionsModel.setAllVisible(true) + definitionsModel.setAllExpandedVisible(true) } else { - definitionsModel.setAllVisible(false) + definitionsModel.setAllExpandedVisible(false) } // After change set "Custom" option diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index cf9697210b..199db1bbaa 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -18,7 +18,6 @@ Item property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel() property Action configureSettings property bool findingSettings - property bool showingAllSettings signal showTooltip(Item item, point location, string text) signal hideTooltip() @@ -140,21 +139,9 @@ Item } menu: SettingVisibilityPresetsMenu { - showingSearchResults: findingSettings - showingAllSettings: showingAllSettings - onShowAllSettings: { - base.showingAllSettings = true; - base.findingSettings = false; - filter.text = ""; - filter.updateDefinitionModel(); - } - onShowSettingVisibilityProfile: - { - base.showingAllSettings = false; - base.findingSettings = false; - filter.text = ""; + definitionsModel.setAllVisible(true); filter.updateDefinitionModel(); } } @@ -219,10 +206,6 @@ Item findingSettings = (text.length > 0); if(findingSettings != lastFindingSettings) { - if(findingSettings) - { - showingAllSettings = false; - } updateDefinitionModel(); lastFindingSettings = findingSettings; } @@ -235,7 +218,7 @@ Item function updateDefinitionModel() { - if(findingSettings || showingAllSettings) + if(findingSettings) { expandedCategories = definitionsModel.expanded.slice(); definitionsModel.expanded = [""]; // keep categories closed while to prevent render while making settings visible one by one @@ -558,13 +541,13 @@ Item MenuItem { //: Settings context menu action - visible: !(findingSettings || showingAllSettings); + visible: !findingSettings text: catalog.i18nc("@action:menu", "Hide this setting"); onTriggered: { definitionsModel.hide(contextMenu.key); // visible settings have changed, so we're no longer showing a preset - if (settingVisibilityPresetsModel.activePreset != "" && !showingAllSettings) + if (settingVisibilityPresetsModel.activePreset != "") { settingVisibilityPresetsModel.setActivePreset("custom"); } @@ -584,7 +567,7 @@ Item return catalog.i18nc("@action:menu", "Keep this setting visible"); } } - visible: (findingSettings || showingAllSettings); + visible: findingSettings onTriggered: { if (contextMenu.settingVisible) @@ -596,7 +579,7 @@ Item definitionsModel.show(contextMenu.key); } // visible settings have changed, so we're no longer showing a preset - if (settingVisibilityPresetsModel.activePreset != "" && !showingAllSettings) + if (settingVisibilityPresetsModel.activePreset != "") { settingVisibilityPresetsModel.setActivePreset("custom"); } From d676b852899bf28d32d9bf8e4075f4962b82129a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 19 Mar 2018 11:09:03 +0100 Subject: [PATCH 4/7] Fix createMaterial() for non-2.85 diameter materials CURA-5113 --- cura/Machines/MaterialManager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index b854dbf29e..24c7ccb8c0 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -498,8 +498,10 @@ class MaterialManager(QObject): # Ensure all settings are saved. self._application.saveSettings() - global_stack = self._application.getGlobalContainerStack() - approximate_diameter = str(round(global_stack.getProperty("material_diameter", "value"))) + machine_manager = self._application.getMachineManager() + extruder_stack = machine_manager.activeStack + + approximate_diameter = str(extruder_stack.approximateMaterialDiameter) root_material_id = "generic_pla" root_material_id = self.getRootMaterialIDForDiameter(root_material_id, approximate_diameter) material_group = self.getMaterialGroup(root_material_id) From 906ebe12e168ba8887fb7c258ec702b9dff947a7 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Mon, 19 Mar 2018 11:46:43 +0100 Subject: [PATCH 5/7] CURA-4400 fix disallowed areas by fixing the limit_to_extruder -1 value --- cura/Settings/ExtruderStack.py | 3 +++ cura/Settings/GlobalStack.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py index 5cdcba68b0..1b12814ab0 100644 --- a/cura/Settings/ExtruderStack.py +++ b/cura/Settings/ExtruderStack.py @@ -5,6 +5,7 @@ from typing import Any, TYPE_CHECKING, Optional from PyQt5.QtCore import pyqtProperty, pyqtSignal +from UM.Application import Application from UM.Decorators import override from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase from UM.Settings.ContainerStack import ContainerStack @@ -111,6 +112,8 @@ class ExtruderStack(CuraContainerStack): limit_to_extruder = super().getProperty(key, "limit_to_extruder", context) if limit_to_extruder is not None: + if limit_to_extruder == -1: + limit_to_extruder = int(Application.getInstance().getMachineManager().defaultExtruderPosition) limit_to_extruder = str(limit_to_extruder) if (limit_to_extruder is not None and limit_to_extruder != "-1") and self.getMetaDataEntry("position") != str(limit_to_extruder): if str(limit_to_extruder) in self.getNextStack().extruders: diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index ae1f1370ed..5d8a4505a5 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -7,6 +7,7 @@ from typing import Any, Dict, Optional from PyQt5.QtCore import pyqtProperty +from UM.Application import Application from UM.Decorators import override from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase @@ -104,6 +105,8 @@ class GlobalStack(CuraContainerStack): # Handle the "limit_to_extruder" property. limit_to_extruder = super().getProperty(key, "limit_to_extruder", context) if limit_to_extruder is not None: + if limit_to_extruder == -1: + limit_to_extruder = int(Application.getInstance().getMachineManager().defaultExtruderPosition) limit_to_extruder = str(limit_to_extruder) if limit_to_extruder is not None and limit_to_extruder != "-1" and limit_to_extruder in self._extruders: if super().getProperty(key, "settable_per_extruder", context): From 4a0b3ace9efa2a0ccff45801ba7b25a5768e6009 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 19 Mar 2018 12:23:35 +0100 Subject: [PATCH 6/7] Fix missing getExtruderPositionValueWithDefault() error PerObjectContainerStack was not a PerObjectContainerStack so it didn't have getExtruderPositionValueWithDefault(), and this will break SliceInfo. --- cura/Settings/PerObjectContainerStack.py | 11 ++++++----- cura/Settings/SettingOverrideDecorator.py | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cura/Settings/PerObjectContainerStack.py b/cura/Settings/PerObjectContainerStack.py index 6c54ed46d5..33111cbed7 100644 --- a/cura/Settings/PerObjectContainerStack.py +++ b/cura/Settings/PerObjectContainerStack.py @@ -3,13 +3,14 @@ from typing import Any, Optional from UM.Application import Application from UM.Decorators import override from UM.Settings.Interfaces import PropertyEvaluationContext -from UM.Settings.ContainerStack import ContainerStack from UM.Settings.SettingInstance import InstanceState +from .CuraContainerStack import CuraContainerStack -class PerObjectContainerStack(ContainerStack): - @override(ContainerStack) +class PerObjectContainerStack(CuraContainerStack): + + @override(CuraContainerStack) def getProperty(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> Any: if context is None: context = PropertyEvaluationContext() @@ -51,8 +52,8 @@ class PerObjectContainerStack(ContainerStack): context.popContainer() return result - @override(ContainerStack) - def setNextStack(self, stack: ContainerStack): + @override(CuraContainerStack) + def setNextStack(self, stack: CuraContainerStack): super().setNextStack(stack) # trigger signal to re-evaluate all default settings diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index d7ae43f938..e853a3a979 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -3,7 +3,6 @@ import copy -from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.SceneNodeDecorator import SceneNodeDecorator from UM.Signal import Signal, signalemitter from UM.Settings.InstanceContainer import InstanceContainer @@ -33,9 +32,11 @@ class SettingOverrideDecorator(SceneNodeDecorator): def __init__(self): super().__init__() - self._stack = PerObjectContainerStack(stack_id = "per_object_stack_" + str(id(self))) + self._stack = PerObjectContainerStack(container_id = "per_object_stack_" + str(id(self))) self._stack.setDirty(False) # This stack does not need to be saved. - self._stack.addContainer(InstanceContainer(container_id = "SettingOverrideInstanceContainer")) + user_container = InstanceContainer(container_id = "SettingOverrideInstanceContainer") + user_container.addMetaDataEntry("type", "user") + self._stack.userChanges = user_container self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId() self._is_non_printing_mesh = False From b13bfaa8e14b690cb036f8af2f5ac22c0f6f9868 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 19 Mar 2018 12:27:12 +0100 Subject: [PATCH 7/7] Rename setVariantGroup() -> setVariant() There is no such thing as VariantGroup. --- cura/Settings/MachineManager.py | 2 +- resources/qml/Menus/NozzleMenu.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 07548e21dd..6debd8d68e 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1227,7 +1227,7 @@ class MachineManager(QObject): self._updateQualityWithMaterial() @pyqtSlot(str, "QVariant") - def setVariantGroup(self, position, container_node): + def setVariant(self, position, container_node): position = str(position) self.blurSettings.emit() with postponeSignals(*self._getContainerChangedSignals(), compress = CompressTechnique.CompressPerParameterValue): diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 43f3b79dd4..886216dab0 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -32,7 +32,7 @@ Menu } exclusiveGroup: group onTriggered: { - Cura.MachineManager.setVariantGroup(menu.extruderIndex, model.container_node); + Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node); } }