From c3bf0b834d6e1a78849ef85604615524f1b2368e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 20 Feb 2018 09:20:01 +0100 Subject: [PATCH 1/5] Fix location of post processing scripts on Linux On Windows and OSX, resources and preferences are stored in the same folder. On Linux, preferences are in ~/.config, resources are in ~/.local/shared. Postprocessing scripts belong in the latter, along with all the other resources (definitions, plugins, themes). Fixes #3356 --- plugins/PostProcessingPlugin/PostProcessingPlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.py b/plugins/PostProcessingPlugin/PostProcessingPlugin.py index f491afbec0..92e31d9135 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.py +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.py @@ -173,7 +173,7 @@ class PostProcessingPlugin(QObject, Extension): Logger.log("d", "Creating post processing plugin view.") ## Load all scripts in the scripts folders - for root in [PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin"), Resources.getStoragePath(Resources.Preferences)]: + for root in [PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin"), Resources.getStoragePath(Resources.Resources)]: path = os.path.join(root, "scripts") if not os.path.isdir(path): try: From aae8a31f00cf9db2b6190a43dbf1658db64311cf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 12 Mar 2018 09:22:59 +0100 Subject: [PATCH 2/5] Don't display extruder count if you can't use it If your printer can only handle one extruder, don't display this drop-down. Don't let users get confused. --- plugins/MachineSettingsAction/MachineSettingsAction.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 4d00904f76..f941ef87b4 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -244,6 +244,7 @@ Cura.MachineAction height: childrenRect.height width: childrenRect.width text: machineExtruderCountProvider.properties.description + visible: extruderCountModel.count >= 2 Row { From 15212d4426b1eb72777e33d9f04dd37127990413 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 12 Mar 2018 09:38:20 +0100 Subject: [PATCH 3/5] Align for readability --- plugins/VersionUpgrade/VersionUpgrade32to33/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade32to33/__init__.py b/plugins/VersionUpgrade/VersionUpgrade32to33/__init__.py index acccfd88dd..c411b4190e 100644 --- a/plugins/VersionUpgrade/VersionUpgrade32to33/__init__.py +++ b/plugins/VersionUpgrade/VersionUpgrade32to33/__init__.py @@ -8,10 +8,10 @@ upgrade = VersionUpgrade32to33.VersionUpgrade32to33() def getMetaData(): return { "version_upgrade": { - # From To Upgrade function + # From To Upgrade function ("definition_changes", 2000004): ("definition_changes", 3000004, upgrade.upgradeInstanceContainer), - ("quality_changes", 2000004): ("quality_changes", 3000004, upgrade.upgradeQualityChanges), - ("user", 2000004): ("user", 3000004, upgrade.upgradeInstanceContainer) + ("quality_changes", 2000004): ("quality_changes", 3000004, upgrade.upgradeQualityChanges), + ("user", 2000004): ("user", 3000004, upgrade.upgradeInstanceContainer) }, "sources": { "definition_changes": { From d98cab48ac464664da24510d981fa560ebbda4ad Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 12 Mar 2018 09:48:03 +0100 Subject: [PATCH 4/5] Get scripts from either Resources or Preferences We must retain the old directory for legacy. People might still have scripts there. --- plugins/PostProcessingPlugin/PostProcessingPlugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.py b/plugins/PostProcessingPlugin/PostProcessingPlugin.py index dc2d93a788..c4b760724b 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.py +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.py @@ -173,7 +173,10 @@ class PostProcessingPlugin(QObject, Extension): Logger.log("d", "Creating post processing plugin view.") ## Load all scripts in the scripts folders - for root in [PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin"), Resources.getStoragePath(Resources.Resources)]: + # The PostProcessingPlugin path is for built-in scripts. + # The Resources path is where the user should store custom scripts. + # The Preferences path is legacy, where the user may previously have stored scripts. + for root in [PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin"), Resources.getStoragePath(Resources.Resources), Resources.getStoragePath(Resources.Preferences)]: path = os.path.join(root, "scripts") if not os.path.isdir(path): try: From 2c5cc17b490e311359df3bedcf293a9f530d6470 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 12 Mar 2018 10:33:40 +0100 Subject: [PATCH 5/5] Fix build plate compatibility check CURA-5078 --- cura/Settings/MachineManager.py | 14 ++++++++++++-- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 144f495997..b09ff9e8bd 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -919,11 +919,21 @@ class MachineManager(QObject): def activeMaterialsCompatible(self): # check material - variant compatibility + result = True + machine_has_buildplate = Util.parseBool(self._global_container_stack.getMetaDataEntry("has_variant_buildplates", False)) if Util.parseBool(self._global_container_stack.getMetaDataEntry("has_materials", False)): for position, extruder in self._global_container_stack.extruders.items(): if not extruder.material.getMetaDataEntry("compatible"): - return False - return True + result = False + break + if machine_has_buildplate: + buildplate_compatibility_dict = extruder.material.getMetaDataEntry("buildplate_compatible") + if buildplate_compatibility_dict: + buildplate_name = self._global_container_stack.variant.getName() + result = buildplate_compatibility_dict.get(buildplate_name, True) + if not result: + break + return result ## Update current quality type and machine after setting material def _updateQualityWithMaterial(self): diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index a7ba423153..e8d0c9d2f0 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -617,7 +617,8 @@ class XmlMaterialProfile(InstanceContainer): from cura.Machines.VariantManager import VariantType variant_manager = CuraApplication.getInstance().getVariantManager() - variant_node = variant_manager.getVariantNode(machine_id, buildplate_id) + variant_node = variant_manager.getVariantNode(machine_id, buildplate_id, + variant_type = VariantType.BUILD_PLATE) if not variant_node: continue