Browse Source

Merge branch 'master' into PP-54_decrease-resolution

# Conflicts:
#	resources/definitions/ultimaker.def.json
#	resources/quality/ultimaker_s3/um_s3_aa0.8_CPE_Superdraft_Print.inst.cfg
#	resources/quality/ultimaker_s3/um_s3_aa0.8_PETG_Superdraft_Print.inst.cfg
#	resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg
#	resources/quality/ultimaker_s5/um_s5_aa0.8_PETG_Superdraft_Print.inst.cfg
j.delarago 2 years ago
parent
commit
b7ad18d149

+ 1 - 1
cura/CuraApplication.py

@@ -127,7 +127,7 @@ class CuraApplication(QtApplication):
     # SettingVersion represents the set of settings available in the machine/extruder definitions.
     # You need to make sure that this version number needs to be increased if there is any non-backwards-compatible
     # changes of the settings.
-    SettingVersion = 19
+    SettingVersion = 20
 
     Created = False
 

+ 3 - 1
cura/PrinterOutput/PrinterOutputDevice.py

@@ -137,7 +137,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
         """
         if self.connectionState != connection_state:
             self._connection_state = connection_state
-            cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack().setMetaDataEntry("is_online", self.isConnected())
+            global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
+            if global_stack:
+                global_stack.setMetaDataEntry("is_online", self.isConnected())
             self.connectionStateChanged.emit(self._id)
 
     @pyqtProperty(int, constant = True)

+ 23 - 15
plugins/VersionUpgrade/VersionUpgrade49to50/VersionUpgrade49to50.py → plugins/VersionUpgrade/VersionUpgrade413to50/VersionUpgrade413to50.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 import configparser
@@ -11,14 +11,19 @@ _removed_settings = {
     "travel_compensate_overlapping_walls_0_enabled",
     "travel_compensate_overlapping_walls_x_enabled",
     "fill_perimeter_gaps",
+    "filter_out_tiny_gaps",
     "wall_min_flow",
     "wall_min_flow_retract",
-    "speed_equalize_flow_enabled",
-    "speed_equalize_flow_min"
+    "speed_equalize_flow_max"
+}
+
+_transformed_settings = {  # These settings have been changed to a new topic, but may have different data type. Used only for setting visibility; the rest is handled separately.
+    "outer_inset_first": "inset_direction",
+    "speed_equalize_flow_enabled": "speed_equalize_flow_width_factor"
 }
 
 
-class VersionUpgrade49to50(VersionUpgrade):
+class VersionUpgrade413to50(VersionUpgrade):
     def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
         """
         Upgrades preferences to remove from the visibility list the settings that were removed in this version.
@@ -34,7 +39,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         parser.read_string(serialized)
 
         # Update version number.
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         # Remove deleted settings from the visible settings list.
         if "general" in parser and "visible_settings" in parser["general"]:
@@ -43,10 +48,11 @@ class VersionUpgrade49to50(VersionUpgrade):
                 if removed in visible_settings:
                     visible_settings.remove(removed)
 
-            # Replace Outer Before Inner Walls with equivalent.
-            if "outer_inset_first" in visible_settings:
-                visible_settings.remove("outer_inset_first")
-                visible_settings.add("inset_direction")
+            # Replace equivalent settings that have been transformed.
+            for old, new in _transformed_settings.items():
+                if old in visible_settings:
+                    visible_settings.remove(old)
+                    visible_settings.add(new)
 
             parser["general"]["visible_settings"] = ";".join(visible_settings)
 
@@ -71,7 +77,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         parser.read_string(serialized)
 
         # Update version number.
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         if "values" in parser:
             # Remove deleted settings from the instance containers.
@@ -86,9 +92,12 @@ class VersionUpgrade49to50(VersionUpgrade):
                     old_value = old_value[1:]
                 parser["values"]["inset_direction"] = f"='outside_in' if ({old_value}) else 'inside_out'"  # Makes it work both with plain setting values and formulas.
 
-            # Disable Fuzzy Skin as it doesn't work with with the libArachne walls
-            if "magic_fuzzy_skin_enabled" in parser["values"]:
-                parser["values"]["magic_fuzzy_skin_enabled"] = "False"
+            # Replace Equalize Filament Flow with equivalent setting.
+            if "speed_equalize_flow_enabled" in parser["values"]:
+                old_value = parser["values"]["speed_equalize_flow_enabled"]
+                if old_value.startswith("="):  # Was already a formula.
+                    old_value = old_value[1:]
+                parser["values"]["speed_equalize_flow_width_factor"] = f"=100 if ({old_value}) else 0"  # If it used to be enabled, set it to 100%. Otherwise 0%.
 
         result = io.StringIO()
         parser.write(result)
@@ -110,8 +119,7 @@ class VersionUpgrade49to50(VersionUpgrade):
         if "metadata" not in parser:
             parser["metadata"] = {}
 
-        parser["general"]["version"] = "5"
-        parser["metadata"]["setting_version"] = "18"
+        parser["metadata"]["setting_version"] = "20"
 
         result = io.StringIO()
         parser.write(result)

+ 11 - 13
plugins/VersionUpgrade/VersionUpgrade49to50/__init__.py → plugins/VersionUpgrade/VersionUpgrade413to50/__init__.py

@@ -1,28 +1,26 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from typing import Any, Dict, TYPE_CHECKING
 
-from . import VersionUpgrade49to50
+from . import VersionUpgrade413to50
 
 if TYPE_CHECKING:
     from UM.Application import Application
 
-upgrade = VersionUpgrade49to50.VersionUpgrade49to50()
+upgrade = VersionUpgrade413to50.VersionUpgrade413to50()
 
 def getMetaData() -> Dict[str, Any]:
-    return {  # Since there is no VersionUpgrade from 48 to 49 yet, upgrade the 48 profiles to 50.
+    return {
         "version_upgrade": {
             # From                           To                              Upgrade function
-            ("preferences", 6000016):        ("preferences", 6000018,        upgrade.upgradePreferences),
-            ("machine_stack", 5000016):      ("machine_stack", 5000018,      upgrade.upgradeStack),
-            ("extruder_train", 5000016):     ("extruder_train", 5000018,     upgrade.upgradeStack),
-            ("machine_stack", 4000018):      ("machine_stack", 5000018,      upgrade.upgradeStack),  # We made a mistake in the arachne beta 1
-            ("extruder_train", 4000018):     ("extruder_train", 5000018,     upgrade.upgradeStack),  # We made a mistake in the arachne beta 1
-            ("definition_changes", 4000016): ("definition_changes", 4000018, upgrade.upgradeInstanceContainer),
-            ("quality_changes", 4000016):    ("quality_changes", 4000018,    upgrade.upgradeInstanceContainer),
-            ("quality", 4000016):            ("quality", 4000018,            upgrade.upgradeInstanceContainer),
-            ("user", 4000016):               ("user", 4000018,               upgrade.upgradeInstanceContainer),
+            ("preferences", 7000019):        ("preferences", 7000020,        upgrade.upgradePreferences),
+            ("machine_stack", 5000019):      ("machine_stack", 5000020,      upgrade.upgradeStack),
+            ("extruder_train", 5000019):     ("extruder_train", 5000020,     upgrade.upgradeStack),
+            ("definition_changes", 4000019): ("definition_changes", 4000020, upgrade.upgradeInstanceContainer),
+            ("quality_changes", 4000019):    ("quality_changes", 4000020,    upgrade.upgradeInstanceContainer),
+            ("quality", 4000019):            ("quality", 4000020,            upgrade.upgradeInstanceContainer),
+            ("user", 4000019):               ("user", 4000020,               upgrade.upgradeInstanceContainer),
         },
         "sources": {
             "preferences": {

+ 8 - 0
plugins/VersionUpgrade/VersionUpgrade413to50/plugin.json

@@ -0,0 +1,8 @@
+{
+    "name": "Version Upgrade 4.13 to 5.0",
+    "author": "Ultimaker B.V.",
+    "version": "1.0.0",
+    "description": "Upgrades configurations from Cura 4.13 to Cura 5.0.",
+    "api": "7.9.0",
+    "i18n-catalog": "cura"
+}

+ 0 - 8
plugins/VersionUpgrade/VersionUpgrade49to50/plugin.json

@@ -1,8 +0,0 @@
-{
-    "name": "Version Upgrade 4.9 to 5.0",
-    "author": "Ultimaker B.V.",
-    "version": "1.0.0",
-    "description": "Upgrades configurations from Cura 4.9 to Cura 5.0.",
-    "api": "7.4.0",
-    "i18n-catalog": "cura"
-}

+ 1 - 1
resources/definitions/fdmextruder.def.json

@@ -6,7 +6,7 @@
         "type": "extruder",
         "author": "Ultimaker",
         "manufacturer": "Unknown",
-        "setting_version": 19,
+        "setting_version": 20,
         "visible": false,
         "position": "0"
     },

+ 8 - 33
resources/definitions/fdmprinter.def.json

@@ -6,7 +6,7 @@
         "type": "machine",
         "author": "Unknown",
         "manufacturer": "Unknown",
-        "setting_version": 19,
+        "setting_version": 20,
         "file_formats": "text/x-gcode;model/stl;application/x-wavefront-obj;application/x3g",
         "visible": false,
         "has_materials": true,
@@ -764,7 +764,7 @@
                     "label": "Scale Fan Speed To 0-1",
                     "description": "Scale the fan speed to be between 0 and 1 instead of between 0 and 256.",
                     "type": "bool",
-                    "default_value": true,
+                    "default_value": false,
                     "settable_per_mesh": false,
                     "settable_per_extruder": false,
                     "settable_per_meshgroup": false
@@ -1088,21 +1088,6 @@
                         }
                     }
                 },
-                "beading_strategy_type":
-                {
-                    "label": "Variable Line Strategy",
-                    "description": "Strategy to use to print the width of a part with a number of walls. This determines how many walls it will use for a certain total width, and how wide each of these lines are. \"Center Deviation\" will print all walls at the nominal line width except the central one(s), causing big variations in the center but very consistent outsides. \"Distributed\" distributes the width equally over all walls. \"Inward Distributed\" is a balance between the other two, distributing the changes in width over all walls but keeping the walls on the outside slightly more consistent.",
-                    "type": "enum",
-                    "enabled": false,
-                    "options":
-                    {
-                        "center_deviation": "Center Deviation",
-                        "distributed": "Distributed",
-                        "inward_distributed": "Inward Distributed"
-                    },
-                    "default_value": "inward_distributed",
-                    "limit_to_extruder": "wall_0_extruder_nr"
-                },
                 "wall_transition_length":
                 {
                     "label": "Wall Transition Length",
@@ -1123,8 +1108,7 @@
                     "type": "int",
                     "maximum_value": "999999",
                     "default_value": 1,
-                    "minimum_value": "1",
-                    "enabled": "beading_strategy_type == 'inward_distributed'"
+                    "minimum_value": "1"
                 },
                 "wall_transition_angle":
                 {
@@ -1205,15 +1189,6 @@
                     "limit_to_extruder": "infill_extruder_nr",
                     "settable_per_mesh": true
                 },
-                "filter_out_tiny_gaps":
-                {
-                    "label": "Filter Out Tiny Gaps",
-                    "description": "Filter out tiny gaps to reduce blobs on outside of model.",
-                    "type": "bool",
-                    "default_value": true,
-                    "limit_to_extruder": "wall_0_extruder_nr",
-                    "settable_per_mesh": true
-                },
                 "min_wall_line_width":
                 {
                     "label": "Minimum Wall Line Width",
@@ -1222,7 +1197,7 @@
                     "minimum_value_warning": ".5 * max(wall_line_width_0, wall_line_width_x)",
                     "maximum_value_warning": "min(wall_line_width_0, wall_line_width_x)",
                     "default_value": 0.3,
-                    "value": "machine_nozzle_size * .75",
+                    "value": "machine_nozzle_size * .85",
                     "type": "float",
                     "settable_per_mesh": true,
                     "children":
@@ -1306,7 +1281,7 @@
                     "label": "Minimum Thin Wall Line Width",
                     "description": "Width of the wall that will replace thin features (according to the Minimum Feature Size) of the model. If the Minimum Wall Line Width is thinner than the thickness of the feature, the wall will become as thick as the feature itself.",
                     "unit": "mm",
-                    "value": "machine_nozzle_size * .75",
+                    "value": "min_wall_line_width",
                     "default_value": 0.2,
                     "minimum_value": "0.001",
                     "minimum_value_warning": "min_feature_size",
@@ -2559,7 +2534,7 @@
                     "unit": "%",
                     "type": "float",
                     "default_value": 100.0,
-                    "enabled": false,
+                    "enabled": true,
                     "minimum_value": "0.001",
                     "minimum_value_warning": "100",
                     "maximum_value_warning": "120",
@@ -2575,7 +2550,7 @@
                             "unit": "%",
                             "type": "float",
                             "default_value": 100.0,
-                            "enabled": false,
+                            "enabled": true,
                             "minimum_value": "0.001",
                             "minimum_value_warning": "100",
                             "maximum_value_warning": "120",
@@ -2591,7 +2566,7 @@
                             "unit": "%",
                             "type": "float",
                             "default_value": 100.0,
-                            "enabled": false,
+                            "enabled": true,
                             "minimum_value": "0.001",
                             "minimum_value_warning": "100",
                             "maximum_value_warning": "120",

+ 13 - 1
resources/definitions/ultimaker.def.json

@@ -53,9 +53,21 @@
         "infill_before_walls": {
             "value": "False"
         },
+        "infill_material_flow": {
+            "value": "(1.95-infill_sparse_density / 100 if infill_sparse_density > 95 else 1) * material_flow"
+        },
         "retraction_combing": {
             "value": "'no_outer_surfaces'"
         },
+        "roofing_layer_count": {
+            "value": "0"
+        },
+        "roofing_material_flow": {
+            "value": "material_flow"
+        },
+        "skin_material_flow": {
+            "value": "0.97 * material_flow"
+        },
         "skin_monotonic" : {
             "value": true
         },
@@ -69,7 +81,7 @@
             "value": "math.ceil(round(bottom_thickness / resolveOrValue('layer_height'), 4))"
         },
         "xy_offset": {
-            "value": "-layer_height * 0.2"
+            "value": "-layer_height * 0.1"
         },
         "meshfix_maximum_resolution": {
             "value": "max(speed_wall_0 / 75, 0.5)"

+ 0 - 3
resources/definitions/ultimaker2_plus.def.json

@@ -34,9 +34,6 @@
         "layer_height_0": {
             "value": "round(machine_nozzle_size / 1.5, 2)"
         },
-        "line_width": {
-            "value": "machine_nozzle_size"
-        },
         "speed_support": {
             "value": "speed_wall_0"
         },

Some files were not shown because too many files changed in this diff