mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:05:56 +08:00
CURA-4182 fix merge conflicts with 3.0 branch
This commit is contained in:
commit
a74a6a59fc
@ -965,7 +965,7 @@ class MachineManager(QObject):
|
|||||||
if container_type == "quality":
|
if container_type == "quality":
|
||||||
stack.quality.nameChanged.disconnect(self._onQualityNameChanged)
|
stack.quality.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
stack.setQuality(container, postpone_emit = postpone_emit)
|
stack.setQuality(container, postpone_emit = postpone_emit)
|
||||||
stack.qualityChanges.nameChanged.connect(self._onQualityNameChanged)
|
stack.quality.nameChanged.connect(self._onQualityNameChanged)
|
||||||
elif container_type == "quality_changes" or container_type is None:
|
elif container_type == "quality_changes" or container_type is None:
|
||||||
# If the container is an empty container, we need to change the quality_changes.
|
# If the container is an empty container, we need to change the quality_changes.
|
||||||
# Quality can never be set to empty.
|
# Quality can never be set to empty.
|
||||||
|
@ -12,7 +12,6 @@ from UM.Mesh.MeshBuilder import MeshBuilder
|
|||||||
from UM.Mesh.MeshReader import MeshReader
|
from UM.Mesh.MeshReader import MeshReader
|
||||||
from UM.Scene.GroupDecorator import GroupDecorator
|
from UM.Scene.GroupDecorator import GroupDecorator
|
||||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||||
from cura.ZOffsetDecorator import ZOffsetDecorator
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
from cura.QualityManager import QualityManager
|
from cura.QualityManager import QualityManager
|
||||||
@ -105,8 +104,8 @@ class ThreeMFReader(MeshReader):
|
|||||||
# Add the setting override decorator, so we can add settings to this node.
|
# Add the setting override decorator, so we can add settings to this node.
|
||||||
if settings:
|
if settings:
|
||||||
um_node.addDecorator(SettingOverrideDecorator())
|
um_node.addDecorator(SettingOverrideDecorator())
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
|
||||||
|
|
||||||
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
# Ensure the correct next container for the SettingOverride decorator is set.
|
# Ensure the correct next container for the SettingOverride decorator is set.
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||||
@ -144,15 +143,12 @@ class ThreeMFReader(MeshReader):
|
|||||||
if len(um_node.getChildren()) > 0:
|
if len(um_node.getChildren()) > 0:
|
||||||
group_decorator = GroupDecorator()
|
group_decorator = GroupDecorator()
|
||||||
um_node.addDecorator(group_decorator)
|
um_node.addDecorator(group_decorator)
|
||||||
|
|
||||||
um_node.setSelectable(True)
|
um_node.setSelectable(True)
|
||||||
|
|
||||||
if um_node.getMeshData():
|
if um_node.getMeshData():
|
||||||
# Assuming that all nodes with mesh data are printable objects
|
# Assuming that all nodes with mesh data are printable objects
|
||||||
# affects (auto) slicing
|
# affects (auto) slicing
|
||||||
sliceable_decorator = SliceableObjectDecorator()
|
sliceable_decorator = SliceableObjectDecorator()
|
||||||
um_node.addDecorator(sliceable_decorator)
|
um_node.addDecorator(sliceable_decorator)
|
||||||
|
|
||||||
return um_node
|
return um_node
|
||||||
|
|
||||||
def read(self, file_name):
|
def read(self, file_name):
|
||||||
@ -172,18 +168,10 @@ class ThreeMFReader(MeshReader):
|
|||||||
|
|
||||||
transform_matrix = Matrix()
|
transform_matrix = Matrix()
|
||||||
mesh_data = um_node.getMeshData()
|
mesh_data = um_node.getMeshData()
|
||||||
|
|
||||||
if mesh_data is not None:
|
if mesh_data is not None:
|
||||||
extents = mesh_data.getExtents()
|
extents = mesh_data.getExtents()
|
||||||
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
|
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
|
||||||
|
|
||||||
# If the object in a saved project is below the bed, keep it that way
|
|
||||||
if extents.minimum.z < 0.0:
|
|
||||||
um_node.addDecorator(ZOffsetDecorator())
|
|
||||||
um_node.callDecoration("setZOffset", extents.minimum.z)
|
|
||||||
|
|
||||||
transform_matrix.setByTranslation(center_vector)
|
transform_matrix.setByTranslation(center_vector)
|
||||||
|
|
||||||
transform_matrix.multiply(um_node.getLocalTransformation())
|
transform_matrix.multiply(um_node.getLocalTransformation())
|
||||||
um_node.setTransformation(transform_matrix)
|
um_node.setTransformation(transform_matrix)
|
||||||
|
|
||||||
@ -207,7 +195,7 @@ class ThreeMFReader(MeshReader):
|
|||||||
translation_matrix.setByTranslation(translation_vector)
|
translation_matrix.setByTranslation(translation_vector)
|
||||||
transformation_matrix.multiply(translation_matrix)
|
transformation_matrix.multiply(translation_matrix)
|
||||||
|
|
||||||
# Third step: 3MF also defines a unit, whereas Cura always assumes mm.
|
# Third step: 3MF also defines a unit, wheras Cura always assumes mm.
|
||||||
scale_matrix = Matrix()
|
scale_matrix = Matrix()
|
||||||
scale_matrix.setByScaleVector(self._getScaleFromUnit(self._unit))
|
scale_matrix.setByScaleVector(self._getScaleFromUnit(self._unit))
|
||||||
transformation_matrix.multiply(scale_matrix)
|
transformation_matrix.multiply(scale_matrix)
|
||||||
|
@ -195,8 +195,8 @@ class CuraEngineBackend(QObject, Backend):
|
|||||||
self.backendStateChange.emit(BackendState.Done)
|
self.backendStateChange.emit(BackendState.Done)
|
||||||
Logger.log("w", "Slice unnecessary, nothing has changed that needs reslicing.")
|
Logger.log("w", "Slice unnecessary, nothing has changed that needs reslicing.")
|
||||||
return
|
return
|
||||||
|
if Application.getInstance().getPrintInformation():
|
||||||
Application.getInstance().getPrintInformation().setToZeroPrintInformation()
|
Application.getInstance().getPrintInformation().setToZeroPrintInformation()
|
||||||
|
|
||||||
self._stored_layer_data = []
|
self._stored_layer_data = []
|
||||||
self._stored_optimized_layer_data = []
|
self._stored_optimized_layer_data = []
|
||||||
|
@ -342,7 +342,7 @@ Item
|
|||||||
{
|
{
|
||||||
id: slider
|
id: slider
|
||||||
width: handleSize
|
width: handleSize
|
||||||
height: parent.height - 2*UM.Theme.getSize("slider_layerview_margin").height
|
height: UM.Theme.getSize("layerview_menu_size").height
|
||||||
anchors.top: parent.bottom
|
anchors.top: parent.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("slider_layerview_margin").height
|
anchors.topMargin: UM.Theme.getSize("slider_layerview_margin").height
|
||||||
anchors.right: layerViewMenu.right
|
anchors.right: layerViewMenu.right
|
||||||
|
@ -442,19 +442,23 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Rectangle
|
||||||
{
|
{
|
||||||
width: (infillCellRight.width / 5) - (UM.Theme.getSize("sidebar_margin").width)
|
id: infillIcon
|
||||||
|
|
||||||
|
width: (parent.width / 5) - (UM.Theme.getSize("sidebar_margin").width)
|
||||||
height: width
|
height: width
|
||||||
|
|
||||||
anchors.right: infillCellRight.right
|
anchors.right: parent.right
|
||||||
anchors.top: infillSlider.top
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 2
|
||||||
|
|
||||||
// we loop over all density icons and only show the one that has the current density and steps
|
// we loop over all density icons and only show the one that has the current density and steps
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
id: infillIconList
|
id: infillIconList
|
||||||
model: infillModel
|
model: infillModel
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
property int activeIndex: {
|
property int activeIndex: {
|
||||||
for (var i = 0; i < infillModel.count; i++) {
|
for (var i = 0; i < infillModel.count; i++) {
|
||||||
@ -472,21 +476,21 @@ Item
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Rectangle
|
||||||
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
visible: infillIconList.activeIndex == index
|
||||||
|
|
||||||
Rectangle {
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color: UM.Theme.getColor("quality_slider_available")
|
||||||
|
|
||||||
|
UM.RecolorImage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: infillIconList.activeIndex == index
|
anchors.margins: 2
|
||||||
|
sourceSize.width: width
|
||||||
UM.RecolorImage {
|
sourceSize.height: width
|
||||||
id: infillIcon
|
source: UM.Theme.getIcon(model.icon)
|
||||||
anchors.fill: parent
|
color: UM.Theme.getColor("quality_slider_unavailable")
|
||||||
sourceSize.width: width
|
|
||||||
sourceSize.height: width
|
|
||||||
source: UM.Theme.getIcon(model.icon)
|
|
||||||
color: UM.Theme.getColor("quality_slider_available")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,15 @@ Item
|
|||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
iconSource: UM.Theme.getIcon(model.icon);
|
iconSource:
|
||||||
|
{
|
||||||
|
var result = UM.Theme.getIcon(model.icon)
|
||||||
|
if(result == "")
|
||||||
|
{
|
||||||
|
return model.location + "/" + model.icon
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
checkable: true;
|
checkable: true;
|
||||||
checked: model.active;
|
checked: model.active;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user