From 8eea60bada0053b7e0c942e685869aa0796ed000 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 17 May 2018 14:28:10 +0200 Subject: [PATCH 1/5] CURA-5358 Fix typos --- cura/Machines/MaterialManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index e357a3fbe1..8b74596667 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -160,11 +160,11 @@ class MaterialManager(QObject): key_data.append(root_material_metadata.get(key)) key_data = tuple(key_data) - # If the key_data doesn't exist, no matter if the material is read only... + # If the key_data doesn't exist, it doesn't matter if the material is read only... if key_data not in material_group_dict: material_group_dict[key_data] = dict() else: - # ...but if key_data exists, we just overrite it if the material is read only, otherwise we skip it + # ...but if key_data exists, we just overwrite it if the material is read only, otherwise we skip it if not machine_node.is_read_only: continue approximate_diameter = root_material_metadata.get("approximate_diameter") From 850f6f9b15a7e2d2504cc1a75e1d2af09bbe0797 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 17 May 2018 16:46:32 +0200 Subject: [PATCH 2/5] Change name to Community materials --- plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index 5b9697eda2..e1ffc6326c 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -15,7 +15,7 @@ Column Label { id: heading - text: toolbox.viewCategory == "material" ? catalog.i18nc("@label", "Maker Choices") : catalog.i18nc("@label", "Community Plugins") + text: toolbox.viewCategory == "material" ? catalog.i18nc("@label", "Community contributions") : catalog.i18nc("@label", "Community plugins") width: parent.width color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") From 1f149b2821f4f52283e84397e44a53fe5c6c8f5b Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 18 May 2018 10:50:54 +0200 Subject: [PATCH 3/5] Do not show not printed models on snapshot for UFP files CURA-5373 --- cura/PreviewPass.py | 7 +++++-- cura/Snapshot.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cura/PreviewPass.py b/cura/PreviewPass.py index f6b963d141..662284c111 100644 --- a/cura/PreviewPass.py +++ b/cura/PreviewPass.py @@ -34,9 +34,10 @@ def prettier_color(color_list): # # This is useful to get a preview image of a scene taken from a different location as the active camera. class PreviewPass(RenderPass): - def __init__(self, width: int, height: int): + def __init__(self, width: int, height: int, skip_non_printed_objects: bool = False): super().__init__("preview", width, height, 0) + self._skip_non_printed_objects = skip_non_printed_objects self._camera = None # type: Optional[Camera] self._renderer = Application.getInstance().getRenderer() @@ -112,7 +113,9 @@ class PreviewPass(RenderPass): batch.render(render_camera) batch_support_mesh.render(render_camera) - batch_non_printing.render(render_camera) + + if not self._skip_non_printed_objects: + batch_non_printing.render(render_camera) self.release() diff --git a/cura/Snapshot.py b/cura/Snapshot.py index 1f2a24aecd..7745712651 100644 --- a/cura/Snapshot.py +++ b/cura/Snapshot.py @@ -43,7 +43,8 @@ class Snapshot: render_width, render_height = active_camera.getWindowSize() render_width = int(render_width) render_height = int(render_height) - preview_pass = PreviewPass(render_width, render_height) + skip_non_printed_objects = True + preview_pass = PreviewPass(render_width, render_height, skip_non_printed_objects) root = scene.getRoot() camera = Camera("snapshot", root) @@ -51,7 +52,7 @@ class Snapshot: # determine zoom and look at bbox = None for node in DepthFirstIterator(root): - if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible(): + if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonPrintingMesh"): if bbox is None: bbox = node.getBoundingBox() else: From 36dbc70813d594ea4e93d1528fd6dad35563608a Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 18 May 2018 14:01:31 +0200 Subject: [PATCH 4/5] Remove unnecessary code for taking snapshot for UFP file CURA-5373 --- cura/PreviewPass.py | 10 ++-------- cura/Snapshot.py | 6 +----- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/cura/PreviewPass.py b/cura/PreviewPass.py index 662284c111..4241a2f243 100644 --- a/cura/PreviewPass.py +++ b/cura/PreviewPass.py @@ -1,7 +1,6 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM.Application import Application -from UM.Math.Color import Color from UM.Resources import Resources from UM.View.RenderPass import RenderPass @@ -34,10 +33,9 @@ def prettier_color(color_list): # # This is useful to get a preview image of a scene taken from a different location as the active camera. class PreviewPass(RenderPass): - def __init__(self, width: int, height: int, skip_non_printed_objects: bool = False): + def __init__(self, width: int, height: int): super().__init__("preview", width, height, 0) - self._skip_non_printed_objects = skip_non_printed_objects self._camera = None # type: Optional[Camera] self._renderer = Application.getInstance().getRenderer() @@ -75,7 +73,6 @@ class PreviewPass(RenderPass): # Create batches to be rendered batch = RenderBatch(self._shader) - batch_non_printing = RenderBatch(self._non_printing_shader, type = RenderBatch.RenderType.Transparent) batch_support_mesh = RenderBatch(self._support_mesh_shader) # Fill up the batch with objects that can be sliced. ` @@ -84,7 +81,7 @@ class PreviewPass(RenderPass): per_mesh_stack = node.callDecoration("getStack") if node.callDecoration("isNonPrintingMesh"): # Non printing mesh - batch_non_printing.addItem(node.getWorldTransformation(), node.getMeshData(), uniforms = {}) + continue elif per_mesh_stack is not None and per_mesh_stack.getProperty("support_mesh", "value") == True: # Support mesh uniforms = {} @@ -114,8 +111,5 @@ class PreviewPass(RenderPass): batch.render(render_camera) batch_support_mesh.render(render_camera) - if not self._skip_non_printed_objects: - batch_non_printing.render(render_camera) - self.release() diff --git a/cura/Snapshot.py b/cura/Snapshot.py index 7745712651..d1bfeea40f 100644 --- a/cura/Snapshot.py +++ b/cura/Snapshot.py @@ -6,13 +6,10 @@ from PyQt5 import QtCore from PyQt5.QtGui import QImage from cura.PreviewPass import PreviewPass -from cura.Scene import ConvexHullNode from UM.Application import Application -from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Math.Matrix import Matrix from UM.Math.Vector import Vector -from UM.Mesh.MeshData import transformVertices from UM.Scene.Camera import Camera from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator @@ -43,8 +40,7 @@ class Snapshot: render_width, render_height = active_camera.getWindowSize() render_width = int(render_width) render_height = int(render_height) - skip_non_printed_objects = True - preview_pass = PreviewPass(render_width, render_height, skip_non_printed_objects) + preview_pass = PreviewPass(render_width, render_height) root = scene.getRoot() camera = Camera("snapshot", root) From e7f70d68c72153985d7fd36ee741e2e552f1070a Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 18 May 2018 17:19:14 +0200 Subject: [PATCH 5/5] Focus on IP address field when adding networked printer --- plugins/UM3NetworkPrinting/DiscoverUM3Action.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml index 72c956b8d7..1cf2074979 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml @@ -354,12 +354,10 @@ Cura.MachineAction onShowDialog: { printerKey = key; - addressText = address; + manualPrinterDialog.show(); addressField.selectAll(); addressField.focus = true; - - manualPrinterDialog.show(); } onAccepted: