From 1bf78c086dd10e91db595b5d042e114582df7ac6 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 21 Sep 2018 12:03:12 +0200 Subject: [PATCH 01/13] Remove import plugins which is not a module --- cura/CuraApplication.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 74c8e805af..e5b24f71d3 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -83,7 +83,6 @@ from cura.Settings.SettingInheritanceManager import SettingInheritanceManager from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager from cura.Machines.VariantManager import VariantManager -from plugins.SliceInfoPlugin.SliceInfo import SliceInfo from .SingleInstance import SingleInstance from .AutoSave import AutoSave @@ -1706,7 +1705,7 @@ class CuraApplication(QtApplication): @pyqtSlot() def showMoreInformationDialogForAnonymousDataCollection(self): try: - slice_info = cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin")) + slice_info = self._plugin_registry.getPluginObject("SliceInfoPlugin") slice_info.showMoreInfoDialog() except PluginNotFoundError: Logger.log("w", "Plugin SliceInfo was not found, so not able to show the info dialog.") From b26c78202ba7fe5e265736e628279e1d2fec4c39 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 21 Sep 2018 10:00:21 +0200 Subject: [PATCH 02/13] Consolidate log entries about excluded materials I got a log where 80% of the log was this particular message. Let's not do that. --- 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 dd6376b5e3..b7f3978db8 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -337,6 +337,7 @@ class MaterialManager(QObject): machine_exclude_materials = machine_definition.getMetaDataEntry("exclude_materials", []) material_id_metadata_dict = dict() # type: Dict[str, MaterialNode] + excluded_materials = set() for current_node in nodes_to_check: if current_node is None: continue @@ -345,13 +346,14 @@ class MaterialManager(QObject): # Do not exclude other materials that are of the same type. for material_id, node in current_node.material_map.items(): if material_id in machine_exclude_materials: - Logger.log("d", "Exclude material [%s] for machine [%s]", - material_id, machine_definition.getId()) + excluded_materials.add(material_id) continue if material_id not in material_id_metadata_dict: material_id_metadata_dict[material_id] = node + Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id)) + return material_id_metadata_dict # From 86d8f8517d2f7ef05107c1be824dab9acf992872 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 21 Sep 2018 13:48:46 +0200 Subject: [PATCH 03/13] In material page was not defined the used extruder nr, for generic materials CURA-5682 --- resources/qml/Preferences/Materials/MaterialsList.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index cb5de685e2..f40a5acdb6 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -19,7 +19,11 @@ Item UM.I18nCatalog { id: catalog; name: "cura"; } Cura.MaterialBrandsModel { id: materialsModel } Cura.FavoriteMaterialsModel { id: favoriteMaterialsModel } - Cura.GenericMaterialsModel { id: genericMaterialsModel } + Cura.GenericMaterialsModel + { + id: genericMaterialsModel + extruderPosition: Cura.ExtruderManager.activeExtruderIndex + } property var currentType: null property var currentBrand: null From 30ef724322314ac241d6b552c364091d8d814b61 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 21 Sep 2018 14:11:59 +0200 Subject: [PATCH 04/13] Update STL MIME type Since march, there is now an official MIME type for STL files. See https://www.iana.org/assignments/media-types/model/stl for the new MIME type specification. Fixes #4141. --- cura.desktop.in | 2 +- cura.sharedmimeinfo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura.desktop.in b/cura.desktop.in index fe61b47217..fbe8b30fed 100644 --- a/cura.desktop.in +++ b/cura.desktop.in @@ -13,6 +13,6 @@ TryExec=@CMAKE_INSTALL_FULL_BINDIR@/cura Icon=cura-icon Terminal=false Type=Application -MimeType=application/sla;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml; +MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png;model/x3d+xml; Categories=Graphics; Keywords=3D;Printing;Slicer; diff --git a/cura.sharedmimeinfo b/cura.sharedmimeinfo index 9629aef5df..23d38795eb 100644 --- a/cura.sharedmimeinfo +++ b/cura.sharedmimeinfo @@ -6,7 +6,7 @@ - + Computer-aided design and manufacturing format From b44fb7ca2429a5ffe99d0c5694206d2bb0fe7e35 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 21 Sep 2018 17:35:46 +0200 Subject: [PATCH 05/13] Select correct material according to the active extruder CURA-5682 --- .../qml/Preferences/Materials/MaterialsList.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsList.qml b/resources/qml/Preferences/Materials/MaterialsList.qml index f40a5acdb6..00bead9650 100644 --- a/resources/qml/Preferences/Materials/MaterialsList.qml +++ b/resources/qml/Preferences/Materials/MaterialsList.qml @@ -17,8 +17,18 @@ Item // Children UM.I18nCatalog { id: catalog; name: "cura"; } - Cura.MaterialBrandsModel { id: materialsModel } - Cura.FavoriteMaterialsModel { id: favoriteMaterialsModel } + Cura.MaterialBrandsModel + { + id: materialsModel + extruderPosition: Cura.ExtruderManager.activeExtruderIndex + } + + Cura.FavoriteMaterialsModel + { + id: favoriteMaterialsModel + extruderPosition: Cura.ExtruderManager.activeExtruderIndex + } + Cura.GenericMaterialsModel { id: genericMaterialsModel From fe8aa02e7ce2c643a4ff58a708eb3bf3f88eaef5 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 24 Sep 2018 11:44:53 +0200 Subject: [PATCH 06/13] Fix a direct signal emission that causes max recursion error CURA-5682 A max recursion error will occur when the user creates a material on the material management page. Too many signals get directly triggered and some of them head back again and causes a max recursion error. --- cura/Settings/CuraContainerStack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/CuraContainerStack.py b/cura/Settings/CuraContainerStack.py index c8d1d9e370..0ec95e2e41 100755 --- a/cura/Settings/CuraContainerStack.py +++ b/cura/Settings/CuraContainerStack.py @@ -291,7 +291,7 @@ class CuraContainerStack(ContainerStack): # Helper to make sure we emit a PyQt signal on container changes. def _onContainersChanged(self, container: Any) -> None: - self.pyqtContainersChanged.emit() + Application.getInstance().callLater(self.pyqtContainersChanged.emit) # Helper that can be overridden to get the "machine" definition, that is, the definition that defines the machine # and its properties rather than, for example, the extruder. Defaults to simply returning the definition property. From c46e0e7556acb6787090cee739960c2b8ed5b581 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 24 Sep 2018 11:59:02 +0200 Subject: [PATCH 07/13] Only print message about excluded materials if there are any Otherwise the message is very strange (with double spaces and such) and unnecessary. --- cura/Machines/MaterialManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index b7f3978db8..0ca9047620 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -352,7 +352,8 @@ class MaterialManager(QObject): if material_id not in material_id_metadata_dict: material_id_metadata_dict[material_id] = node - Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id)) + if excluded_materials: + Logger.log("d", "Exclude materials {excluded_materials} for machine {machine_definition_id}".format(excluded_materials = ", ".join(excluded_materials), machine_definition_id = machine_definition_id)) return material_id_metadata_dict From a8493ee35d5bc68c6b1e55a6248ab78ea64b7257 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Sep 2018 11:24:37 +0200 Subject: [PATCH 08/13] Give black materials at least some albedo Otherwise you can't see the diffuse reflections and the entire thing just becomes a black silhouette. --- plugins/SimulationView/layers3d.shader | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/SimulationView/layers3d.shader b/plugins/SimulationView/layers3d.shader index 03e279e9eb..de2b9335d8 100644 --- a/plugins/SimulationView/layers3d.shader +++ b/plugins/SimulationView/layers3d.shader @@ -256,6 +256,7 @@ fragment41core = out vec4 frag_color; uniform mediump vec4 u_ambientColor; + uniform mediump vec4 u_minimumAlbedo; uniform highp vec3 u_lightPosition; void main() @@ -263,7 +264,7 @@ fragment41core = mediump vec4 finalColor = vec4(0.0); float alpha = f_color.a; - finalColor.rgb += f_color.rgb * 0.3; + finalColor.rgb += f_color.rgb * 0.2 + u_minimumAlbedo.rgb; highp vec3 normal = normalize(f_normal); highp vec3 light_dir = normalize(u_lightPosition - f_vertex); @@ -285,6 +286,7 @@ u_extruder_opacity = [1.0, 1.0, 1.0, 1.0] u_specularColor = [0.4, 0.4, 0.4, 1.0] u_ambientColor = [0.3, 0.3, 0.3, 0.0] u_diffuseColor = [1.0, 0.79, 0.14, 1.0] +u_minimumAlbedo = [0.1, 0.1, 0.1, 1.0] u_shininess = 20.0 u_show_travel_moves = 0 From 8837ffc06ddd7a9177e52339088a0f89c2a28624 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 25 Sep 2018 11:52:50 +0200 Subject: [PATCH 09/13] Fix mateial management QML reference CURA-5682 --- .../Preferences/Materials/MaterialsDetailsPanel.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml b/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml index f72d93aff3..92970f40e2 100644 --- a/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml +++ b/resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml @@ -27,9 +27,20 @@ Item function updateMaterialPropertiesObject() { + // DRAGON WARNING!!! DO NOT TOUCH THIS IF YOU DON'T KNOW. + // TL;DR: Always update "container_id" first! + // + // Other widgets such as MaterialsView have bindings towards "materialProperties" and its properties. Here the + // properties are updated one by one, and each change can trigger a reaction on those widgets that have + // connections to the property gets changed, and some reactions will use functions such as + // ContainerManager.getContainerMetaDataEntry() to fetch data using the "container_id" as the reference. + // We need to change "container_id" first so any underlying triggers will use the correct "container_id" to + // fetch data. Or, for example, if we change GUID first, which triggered the weight widget to fetch weight + // before we can update "container_id", so it will fetch weight with the wrong (old) "container_id". + materialProperties.container_id = currentItem.id + materialProperties.name = currentItem.name || "Unknown" materialProperties.guid = currentItem.GUID - materialProperties.container_id = currentItem.id materialProperties.brand = currentItem.brand || "Unknown" materialProperties.material = currentItem.material || "Unknown" materialProperties.color_name = currentItem.color_name || "Yellow" From 987ae730787170f8fb5cd735e257fbe28ee04aa4 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 25 Sep 2018 13:15:26 +0200 Subject: [PATCH 10/13] Remove call to undefined function. --- resources/qml/Menus/SettingVisibilityPresetsMenu.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml index 2175cfa402..c34dc2a484 100644 --- a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml +++ b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml @@ -29,7 +29,6 @@ Menu onTriggered: { settingVisibilityPresetsModel.setActivePreset(model.id); - showSettingVisibilityProfile(); } } From 3127108d008ab5547ba5e3f1cf45b474d2e88b91 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 25 Sep 2018 13:17:14 +0200 Subject: [PATCH 11/13] Only set top/bottom pattern to concentric for initial layer I'm taking responsibility for this. I'm changing it as a reaction to #4167 since I think concentric is good for the first layer but not so good for the rest of the layers. That user seems to agree but it hasn't been tested thoroughly. It's my intuition, sorry if it went wrong. --- resources/definitions/creality_cr10.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/creality_cr10.def.json b/resources/definitions/creality_cr10.def.json index b727834db3..fb63867163 100644 --- a/resources/definitions/creality_cr10.def.json +++ b/resources/definitions/creality_cr10.def.json @@ -37,7 +37,7 @@ "top_bottom_thickness": { "default_value": 0.6 }, - "top_bottom_pattern": { + "top_bottom_pattern_0": { "default_value": "concentric" }, "infill_pattern": { From 52ffe39c07cf040e5e44c503807a4075ef4b3fee Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 27 Sep 2018 10:33:50 +0200 Subject: [PATCH 12/13] Small fixes in settings --- cura/API/Account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index c30b8d4586..7944290f6e 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -36,11 +36,11 @@ class Account(QObject): OAUTH_SERVER_URL= self._oauth_root, CALLBACK_PORT=self._callback_port, CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), - CLIENT_ID="um---------------ultimaker_cura", + CLIENT_ID="um---------------ultimaker_cura_drive_plugin", CLIENT_SCOPES="user.read drive.backups.read drive.backups.write client.package.download", AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_SUCCESS_REDIRECT="{}/auth-success".format(self._cloud_api_root), - AUTH_FAILED_REDIRECT="{}//auth-error".format(self._cloud_api_root) + AUTH_FAILED_REDIRECT="{}/auth-error".format(self._cloud_api_root) ) self._authorization_service = AuthorizationService(Application.getInstance().getPreferences(), self._oauth_settings) From 246d12a596c8122516d15d82742ecc3dca369aad Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 27 Sep 2018 10:48:22 +0200 Subject: [PATCH 13/13] Remove client.package.download scope until that is deployed on production --- cura/API/Account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index 7944290f6e..e28f943009 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -37,7 +37,7 @@ class Account(QObject): CALLBACK_PORT=self._callback_port, CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), CLIENT_ID="um---------------ultimaker_cura_drive_plugin", - CLIENT_SCOPES="user.read drive.backups.read drive.backups.write client.package.download", + CLIENT_SCOPES="user.read drive.backups.read drive.backups.write", AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_SUCCESS_REDIRECT="{}/auth-success".format(self._cloud_api_root), AUTH_FAILED_REDIRECT="{}/auth-error".format(self._cloud_api_root)