From d2de039371f3b1ebc0e45637972fcdb5397c13e9 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 21 Sep 2017 16:08:46 +0200 Subject: [PATCH 1/4] dont disappear when click on splashscreen CURA-4343 --- cura/CuraSplashScreen.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/CuraSplashScreen.py b/cura/CuraSplashScreen.py index 4fc81e815f..eedf1e3d53 100644 --- a/cura/CuraSplashScreen.py +++ b/cura/CuraSplashScreen.py @@ -41,6 +41,10 @@ class CuraSplashScreen(QSplashScreen): self._loading_image_rotation_angle -= 10 self.repaint() + # Override the mousePressEvent so the splashscreen doesn't disappear when clicked + def mousePressEvent(self, mouse_event): + pass + def drawContents(self, painter): if self._to_stop: return From e7e24caf97851f999c807fc88e9588fbd42108b2 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 22 Sep 2017 09:31:11 +0200 Subject: [PATCH 2/4] CURA-4269 small code improvement for z-offset in project loading --- plugins/3MFReader/ThreeMFReader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index c264c381f8..283a685498 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -204,10 +204,11 @@ class ThreeMFReader(MeshReader): # Pre multiply the transformation with the loaded transformation, so the data is handled correctly. um_node.setTransformation(um_node.getLocalTransformation().preMultiply(transformation_matrix)) - # If the object in a saved project is below the bed, keep it that way - if um_node.getMeshData() != None and um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y < 0: + # Check if the model is positioned below the build plate and honor that when loading project files. + if um_node.getMeshData() is not None: + z_offset_value = um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y um_node.addDecorator(ZOffsetDecorator()) - um_node.callDecoration("setZOffset",um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y) + um_node.callDecoration("setZOffset", z_offset_value) result.append(um_node) From 21ea99d9f2c77242c17ee35317f403b23597343c Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 22 Sep 2017 09:34:24 +0200 Subject: [PATCH 3/4] CURA-4269 small code improvement for z-offset in project loading --- plugins/3MFReader/ThreeMFReader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 283a685498..57b3b9e0fd 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -206,9 +206,10 @@ class ThreeMFReader(MeshReader): # Check if the model is positioned below the build plate and honor that when loading project files. if um_node.getMeshData() is not None: - z_offset_value = um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y - um_node.addDecorator(ZOffsetDecorator()) - um_node.callDecoration("setZOffset", z_offset_value) + minimum_z_value = um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y # y is z in transformation coordinates + if minimum_z_value < 0: + um_node.addDecorator(ZOffsetDecorator()) + um_node.callDecoration("setZOffset", minimum_z_value) result.append(um_node) From ab8bcc4ae38564c16b45bf40cd06983e5fa31cbf Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 22 Sep 2017 09:51:59 +0200 Subject: [PATCH 4/4] small code fixes --- cura/Settings/ProfilesModel.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py index e39ed949b0..c1f41c58d2 100644 --- a/cura/Settings/ProfilesModel.py +++ b/cura/Settings/ProfilesModel.py @@ -110,12 +110,11 @@ class ProfilesModel(InstanceContainersModel): # active machine and material, and later yield the right ones. tmp_all_quality_items = OrderedDict() for item in super()._recomputeItems(): - profile = container_registry.findContainers(id = item["id"]) + profile = container_registry.findContainers(id=item["id"]) quality_type = profile[0].getMetaDataEntry("quality_type") if profile else "" if quality_type not in tmp_all_quality_items: - tmp_all_quality_items[quality_type] = {"suitable_container": None, - "all_containers": []} + tmp_all_quality_items[quality_type] = {"suitable_container": None, "all_containers": []} tmp_all_quality_items[quality_type]["all_containers"].append(item) if tmp_all_quality_items[quality_type]["suitable_container"] is None and profile[0] in qualities: @@ -142,9 +141,9 @@ class ProfilesModel(InstanceContainersModel): # Now all the containers are set for item in containers: - profile = container_registry.findContainers(id = item["id"]) + profile = container_registry.findContainers(id=item["id"]) if not profile: - item["layer_height"] = "" #Can't update a profile that is unknown. + item["layer_height"] = "" # Can't update a profile that is unknown. item["available"] = False yield item continue @@ -152,13 +151,13 @@ class ProfilesModel(InstanceContainersModel): profile = profile[0] item["available"] = profile in qualities - #Easy case: This profile defines its own layer height. + # Easy case: This profile defines its own layer height. if profile.hasProperty("layer_height", "value"): self._setItemLayerHeight(item, profile.getProperty("layer_height", "value"), unit) yield item continue - #Quality-changes profile that has no value for layer height. Get the corresponding quality profile and ask that profile. + # Quality-changes profile that has no value for layer height. Get the corresponding quality profile and ask that profile. quality_type = profile.getMetaDataEntry("quality_type", None) if quality_type: quality_results = machine_manager.determineQualityAndQualityChangesForQualityType(quality_type)