mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Merge branch 'master' into python_type_hinting
This commit is contained in:
commit
eb43806d7a
51 changed files with 9425 additions and 219 deletions
|
@ -119,7 +119,7 @@ class ThreeMFReader(MeshReader):
|
|||
Job.yieldThread()
|
||||
|
||||
# TODO: We currently do not check for normals and simply recalculate them.
|
||||
mesh_builder.calculateNormals()
|
||||
mesh_builder.calculateNormals(fast=True)
|
||||
mesh_builder.setFileName(name)
|
||||
mesh_data = mesh_builder.build()
|
||||
|
||||
|
|
|
@ -70,8 +70,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._variant_type
|
||||
|
||||
def setVariantType(self, variant_type):
|
||||
self._variant_type = variant_type
|
||||
self.variantTypeChanged.emit()
|
||||
if self._variant_type != variant_type:
|
||||
self._variant_type = variant_type
|
||||
self.variantTypeChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=machineTypeChanged)
|
||||
def machineType(self):
|
||||
|
@ -82,8 +83,9 @@ class WorkspaceDialog(QObject):
|
|||
self.machineTypeChanged.emit()
|
||||
|
||||
def setNumUserSettings(self, num_user_settings):
|
||||
self._num_user_settings = num_user_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
if self._num_user_settings != num_user_settings:
|
||||
self._num_user_settings = num_user_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify=numUserSettingsChanged)
|
||||
def numUserSettings(self):
|
||||
|
@ -94,40 +96,45 @@ class WorkspaceDialog(QObject):
|
|||
return self._objects_on_plate
|
||||
|
||||
def setHasObjectsOnPlate(self, objects_on_plate):
|
||||
self._objects_on_plate = objects_on_plate
|
||||
self.objectsOnPlateChanged.emit()
|
||||
if self._objects_on_plate != objects_on_plate:
|
||||
self._objects_on_plate = objects_on_plate
|
||||
self.objectsOnPlateChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify = materialLabelsChanged)
|
||||
def materialLabels(self):
|
||||
return self._material_labels
|
||||
|
||||
def setMaterialLabels(self, material_labels):
|
||||
self._material_labels = material_labels
|
||||
self.materialLabelsChanged.emit()
|
||||
if self._material_labels != material_labels:
|
||||
self._material_labels = material_labels
|
||||
self.materialLabelsChanged.emit()
|
||||
|
||||
@pyqtProperty("QVariantList", notify=extrudersChanged)
|
||||
def extruders(self):
|
||||
return self._extruders
|
||||
|
||||
def setExtruders(self, extruders):
|
||||
self._extruders = extruders
|
||||
self.extrudersChanged.emit()
|
||||
if self._extruders != extruders:
|
||||
self._extruders = extruders
|
||||
self.extrudersChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify = machineNameChanged)
|
||||
def machineName(self):
|
||||
return self._machine_name
|
||||
|
||||
def setMachineName(self, machine_name):
|
||||
self._machine_name = machine_name
|
||||
self.machineNameChanged.emit()
|
||||
if self._machine_name != machine_name:
|
||||
self._machine_name = machine_name
|
||||
self.machineNameChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=qualityTypeChanged)
|
||||
def qualityType(self):
|
||||
return self._quality_type
|
||||
|
||||
def setQualityType(self, quality_type):
|
||||
self._quality_type = quality_type
|
||||
self.qualityTypeChanged.emit()
|
||||
if self._quality_type != quality_type:
|
||||
self._quality_type = quality_type
|
||||
self.qualityTypeChanged.emit()
|
||||
|
||||
@pyqtProperty(int, notify=numSettingsOverridenByQualityChangesChanged)
|
||||
def numSettingsOverridenByQualityChanges(self):
|
||||
|
@ -142,8 +149,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._quality_name
|
||||
|
||||
def setQualityName(self, quality_name):
|
||||
self._quality_name = quality_name
|
||||
self.qualityNameChanged.emit()
|
||||
if self._quality_name != quality_name:
|
||||
self._quality_name = quality_name
|
||||
self.qualityNameChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=activeModeChanged)
|
||||
def activeMode(self):
|
||||
|
@ -165,8 +173,9 @@ class WorkspaceDialog(QObject):
|
|||
return self._num_visible_settings
|
||||
|
||||
def setNumVisibleSettings(self, num_visible_settings):
|
||||
self._num_visible_settings = num_visible_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
if self._num_visible_settings != num_visible_settings:
|
||||
self._num_visible_settings = num_visible_settings
|
||||
self.numVisibleSettingsChanged.emit()
|
||||
|
||||
@pyqtProperty(bool, notify = machineConflictChanged)
|
||||
def machineConflict(self):
|
||||
|
@ -191,16 +200,19 @@ class WorkspaceDialog(QObject):
|
|||
Application.getInstance().getBackend().close()
|
||||
|
||||
def setMaterialConflict(self, material_conflict):
|
||||
self._has_material_conflict = material_conflict
|
||||
self.materialConflictChanged.emit()
|
||||
if self._has_material_conflict != material_conflict:
|
||||
self._has_material_conflict = material_conflict
|
||||
self.materialConflictChanged.emit()
|
||||
|
||||
def setMachineConflict(self, machine_conflict):
|
||||
self._has_machine_conflict = machine_conflict
|
||||
self.machineConflictChanged.emit()
|
||||
if self._has_machine_conflict != machine_conflict:
|
||||
self._has_machine_conflict = machine_conflict
|
||||
self.machineConflictChanged.emit()
|
||||
|
||||
def setQualityChangesConflict(self, quality_changes_conflict):
|
||||
self._has_quality_changes_conflict = quality_changes_conflict
|
||||
self.qualityChangesConflictChanged.emit()
|
||||
if self._has_quality_changes_conflict != quality_changes_conflict:
|
||||
self._has_quality_changes_conflict = quality_changes_conflict
|
||||
self.qualityChangesConflictChanged.emit()
|
||||
|
||||
def getResult(self):
|
||||
if "machine" in self._result and not self._has_machine_conflict:
|
||||
|
|
|
@ -46,7 +46,7 @@ class ThreeMFWriter(MeshWriter):
|
|||
result += str(matrix._data[2,2]) + " "
|
||||
result += str(matrix._data[0,3]) + " "
|
||||
result += str(matrix._data[1,3]) + " "
|
||||
result += str(matrix._data[2,3]) + " "
|
||||
result += str(matrix._data[2,3])
|
||||
return result
|
||||
|
||||
## Should we store the archive
|
||||
|
@ -80,10 +80,11 @@ class ThreeMFWriter(MeshWriter):
|
|||
model_relation_element = ET.SubElement(relations_element, "Relationship", Target = "/3D/3dmodel.model", Id = "rel0", Type = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel")
|
||||
|
||||
model = ET.Element("model", unit = "millimeter", xmlns = self._namespaces["3mf"])
|
||||
model.set("xmlns:cura", self._namespaces["cura"])
|
||||
|
||||
# Add the version of Cura this was created with. As "CuraVersion" is not a recognised metadata name
|
||||
# by 3mf itself, we place it in our own namespace.
|
||||
version_metadata = ET.SubElement(model, "metadata", xmlns = self._namespaces["cura"], name = "CuraVersion")
|
||||
# Add the version of Cura this was created with. Since there is no "version" or similar metadata name we need
|
||||
# to prefix it with the cura namespace, as specified by the 3MF specification.
|
||||
version_metadata = ET.SubElement(model, "metadata", name = "cura:version")
|
||||
version_metadata.text = Application.getInstance().getVersion()
|
||||
|
||||
resources = ET.SubElement(model, "resources")
|
||||
|
|
|
@ -98,6 +98,9 @@ Use a mesh to specify a volume within which to classify nothing as overhang for
|
|||
*Delta printer support
|
||||
This release adds support for printers with elliptic buildplates. This feature has not been extensively tested so please let us know if it works or get involved in improving it.
|
||||
|
||||
*AppImage for Linux
|
||||
The Linux distribution is now in AppImage format, which makes Cura easier to install.
|
||||
|
||||
*bugfixes
|
||||
The user is now notified when a new version of Cura is available.
|
||||
When searching in the setting visibility preferences, the category for each setting is always displayed.
|
||||
|
@ -122,6 +125,8 @@ There are no more unnecessary retractions in support.
|
|||
Each layer now has less extruder switches than the machine has extruders.
|
||||
Concentric infill doesn’t generate the first infill perimeter next to the walls.
|
||||
Extruder priming now always happens on the first layer.
|
||||
Raising the build plate of the Ultimaker 2 now has the proper speed again.
|
||||
Changing material while the Ultimaker 2 is paused works again.
|
||||
|
||||
[2.3.1]
|
||||
*Layer Height in Profile Selection
|
||||
|
|
|
@ -12,11 +12,9 @@ UM.Dialog
|
|||
{
|
||||
width: 350 * Screen.devicePixelRatio;
|
||||
minimumWidth: 350 * Screen.devicePixelRatio;
|
||||
maximumWidth: 350 * Screen.devicePixelRatio;
|
||||
|
||||
height: 250 * Screen.devicePixelRatio;
|
||||
minimumHeight: 250 * Screen.devicePixelRatio;
|
||||
maximumHeight: 250 * Screen.devicePixelRatio;
|
||||
|
||||
title: catalog.i18nc("@title:window", "Convert Image...")
|
||||
|
||||
|
@ -158,11 +156,10 @@ UM.Dialog
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Item {
|
||||
width: 180
|
||||
height: 20
|
||||
Layout.fillWidth:true
|
||||
color: "transparent"
|
||||
Layout.fillWidth: true
|
||||
|
||||
Slider {
|
||||
id: smoothing
|
||||
|
|
|
@ -60,6 +60,8 @@ class LayerView(View):
|
|||
self._proxy = LayerViewProxy.LayerViewProxy()
|
||||
self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged)
|
||||
|
||||
self._legend_items = None
|
||||
|
||||
Preferences.getInstance().addPreference("view/top_layer_count", 5)
|
||||
Preferences.getInstance().addPreference("view/only_show_top_layers", False)
|
||||
Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged)
|
||||
|
@ -110,7 +112,7 @@ class LayerView(View):
|
|||
|
||||
if not self._ghost_shader:
|
||||
self._ghost_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "color.shader"))
|
||||
self._ghost_shader.setUniformValue("u_color", Color(32, 32, 32, 96))
|
||||
self._ghost_shader.setUniformValue("u_color", Color(*Application.getInstance().getTheme().getColor("layerview_ghost").getRgb()))
|
||||
|
||||
for node in DepthFirstIterator(scene.getRoot()):
|
||||
# We do not want to render ConvexHullNode as it conflicts with the bottom layers.
|
||||
|
@ -194,6 +196,9 @@ class LayerView(View):
|
|||
|
||||
if not self._layerview_composite_shader:
|
||||
self._layerview_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("LayerView"), "layerview_composite.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._layerview_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._layerview_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
|
||||
if not self._composite_pass:
|
||||
self._composite_pass = self.getRenderer().getRenderPass("composite")
|
||||
|
@ -203,6 +208,8 @@ class LayerView(View):
|
|||
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
||||
self._composite_pass.setCompositeShader(self._layerview_composite_shader)
|
||||
|
||||
Application.getInstance().setViewLegendItems(self._getLegendItems())
|
||||
|
||||
elif event.type == Event.ViewDeactivateEvent:
|
||||
self._wireprint_warning_message.hide()
|
||||
Application.getInstance().globalContainerStackChanged.disconnect(self._onGlobalStackChanged)
|
||||
|
@ -212,6 +219,8 @@ class LayerView(View):
|
|||
self._composite_pass.setLayerBindings(self._old_layer_bindings)
|
||||
self._composite_pass.setCompositeShader(self._old_composite_shader)
|
||||
|
||||
Application.getInstance().setViewLegendItems([])
|
||||
|
||||
def _onGlobalStackChanged(self):
|
||||
if self._global_container_stack:
|
||||
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||
|
@ -261,6 +270,24 @@ class LayerView(View):
|
|||
|
||||
self._startUpdateTopLayers()
|
||||
|
||||
def _getLegendItems(self):
|
||||
if self._legend_items is None:
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._legend_items = [
|
||||
{"color": theme.getColor("layerview_inset_0").name(), "title": catalog.i18nc("@label:layerview polygon type", "Outer Wall")}, # Inset0Type
|
||||
{"color": theme.getColor("layerview_inset_x").name(), "title": catalog.i18nc("@label:layerview polygon type", "Inner Wall")}, # InsetXType
|
||||
{"color": theme.getColor("layerview_skin").name(), "title": catalog.i18nc("@label:layerview polygon type", "Top / Bottom")}, # SkinType
|
||||
{"color": theme.getColor("layerview_infill").name(), "title": catalog.i18nc("@label:layerview polygon type", "Infill")}, # InfillType
|
||||
{"color": theme.getColor("layerview_support").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Skin")}, # SupportType
|
||||
{"color": theme.getColor("layerview_support_infill").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Infill")}, # SupportInfillType
|
||||
{"color": theme.getColor("layerview_support_interface").name(), "title": catalog.i18nc("@label:layerview polygon type", "Support Interface")}, # SupportInterfaceType
|
||||
{"color": theme.getColor("layerview_skirt").name(), "title": catalog.i18nc("@label:layerview polygon type", "Build Plate Adhesion")}, # SkirtType
|
||||
{"color": theme.getColor("layerview_move_combing").name(), "title": catalog.i18nc("@label:layerview polygon type", "Travel Move")}, # MoveCombingType
|
||||
{"color": theme.getColor("layerview_move_retraction").name(), "title": catalog.i18nc("@label:layerview polygon type", "Retraction Move")}, # MoveRetractionType
|
||||
#{"color": theme.getColor("layerview_none").name(), "title": catalog.i18nc("@label:layerview polygon type", "Unknown")} # NoneType
|
||||
]
|
||||
return self._legend_items
|
||||
|
||||
|
||||
class _CreateTopLayersJob(Job):
|
||||
def __init__(self, scene, layer_number, solid_layers):
|
||||
|
|
|
@ -41,8 +41,9 @@ Item
|
|||
width: valueLabel.width + UM.Theme.getSize("default_margin").width
|
||||
Behavior on height { NumberAnimation { duration: 50; } }
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: UM.Theme.getColor("slider_groove_border");
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("slider_groove_border")
|
||||
color: UM.Theme.getColor("tool_panel_background")
|
||||
|
||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from UM.Application import Application
|
|||
from UM.Preferences import Preferences
|
||||
from UM.View.Renderer import Renderer
|
||||
from UM.Settings.Validator import ValidatorState
|
||||
|
||||
from UM.Math.Color import Color
|
||||
from UM.View.GL.OpenGL import OpenGL
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
@ -36,11 +36,14 @@ class SolidView(View):
|
|||
|
||||
if not self._enabled_shader:
|
||||
self._enabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "overhang.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._enabled_shader.setUniformValue("u_overhangColor", Color(*theme.getColor("model_overhang").getRgb()))
|
||||
|
||||
if not self._disabled_shader:
|
||||
self._disabled_shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "striped.shader"))
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor1", [0.48, 0.48, 0.48, 1.0])
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor2", [0.68, 0.68, 0.68, 1.0])
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor1", Color(*theme.getColor("model_unslicable").getRgb()))
|
||||
self._disabled_shader.setUniformValue("u_diffuseColor2", Color(*theme.getColor("model_unslicable_alt").getRgb()))
|
||||
self._disabled_shader.setUniformValue("u_width", 50.0)
|
||||
|
||||
multi_extrusion = False
|
||||
|
@ -89,7 +92,7 @@ class SolidView(View):
|
|||
extruder_index = max(0, self._extruders_model.find("id", extruder_id))
|
||||
try:
|
||||
material_color = self._extruders_model.getItem(extruder_index)["color"]
|
||||
except KeyError:
|
||||
except KeyError:
|
||||
material_color = self._extruders_model.defaultColors[0]
|
||||
|
||||
if extruder_index != ExtruderManager.getInstance().activeExtruderIndex:
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
import os.path
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Math.Color import Color
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Event import Event
|
||||
from UM.View.View import View
|
||||
|
@ -31,7 +33,7 @@ class XRayView(View):
|
|||
|
||||
if not self._xray_shader:
|
||||
self._xray_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray.shader"))
|
||||
self._xray_shader.setUniformValue("u_color", [0.1, 0.1, 0.2, 1.0])
|
||||
self._xray_shader.setUniformValue("u_color", Color(*Application.getInstance().getTheme().getColor("xray").getRgb()))
|
||||
|
||||
for node in BreadthFirstIterator(scene.getRoot()):
|
||||
if not node.render(renderer):
|
||||
|
@ -58,6 +60,10 @@ class XRayView(View):
|
|||
|
||||
if not self._xray_composite_shader:
|
||||
self._xray_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray_composite.shader"))
|
||||
theme = Application.getInstance().getTheme()
|
||||
self._xray_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_error_color", Color(*theme.getColor("xray_error").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
|
||||
if not self._composite_pass:
|
||||
self._composite_pass = self.getRenderer().getRenderPass("composite")
|
||||
|
|
|
@ -22,6 +22,7 @@ fragment =
|
|||
uniform float u_outline_strength;
|
||||
uniform vec4 u_outline_color;
|
||||
uniform vec4 u_error_color;
|
||||
uniform vec4 u_background_color;
|
||||
|
||||
const vec3 x_axis = vec3(1.0, 0.0, 0.0);
|
||||
const vec3 y_axis = vec3(0.0, 1.0, 0.0);
|
||||
|
@ -37,7 +38,7 @@ fragment =
|
|||
kernel[3] = 1.0; kernel[4] = -4.0; kernel[5] = 1.0;
|
||||
kernel[6] = 0.0; kernel[7] = 1.0; kernel[8] = 0.0;
|
||||
|
||||
vec4 result = vec4(0.965, 0.965, 0.965, 1.0);
|
||||
vec4 result = u_background_color;
|
||||
vec4 layer0 = texture2D(u_layer0, v_uvs);
|
||||
|
||||
result = layer0 * layer0.a + result * (1.0 - layer0.a);
|
||||
|
@ -70,6 +71,7 @@ fragment =
|
|||
u_layer0 = 0
|
||||
u_layer1 = 1
|
||||
u_layer2 = 2
|
||||
u_background_color = [0.965, 0.965, 0.965, 1.0]
|
||||
u_outline_strength = 1.0
|
||||
u_outline_color = [0.05, 0.66, 0.89, 1.0]
|
||||
u_error_color = [1.0, 0.0, 0.0, 1.0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue