Browse Source

Merge branch 'main' into CURA-11364_add_sentry_engine

Casper Lamboo 1 year ago
parent
commit
1dc350012d

+ 3 - 3
.github/ISSUE_TEMPLATE/SlicingCrash.yaml

@@ -23,14 +23,14 @@ body:
 - type: input
   attributes:
     label: Cura Version
-    placeholder: 5.3.1
+    placeholder: 5.6.0
   validations:
     required: true
 - type: markdown
   attributes:
     value: |
-      We work hard on improving our slicing crashes. Our most recent release is 5.3.1.
-      If you are not on the latest version of Cura, [you can download it here](https://github.com/Ultimaker/Cura/releases/tag/5.3.1)
+      We work hard on improving our slicing crashes. Our most recent release is 5.6.0.
+      If you are not on the latest version of Cura, [you can download it here](https://github.com/Ultimaker/Cura/releases/latest)
 - type: input
   attributes:
     label: Operating System

+ 5 - 2
.github/workflows/conan-package-create.yml

@@ -139,7 +139,10 @@ jobs:
           conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
 
       - name: Add Cura private Artifactory remote
-        run: conan remote add cura-private https://ultimaker.jfrog.io/artifactory/api/conan/cura-private True
+        run: conan remote add cura-private-conan-dev https://cura.jfrog.io/artifactory/api/conan/cura-private-conan-dev True
+
+      - name: Set GH service account for remote cura-conan-dev
+        run: conan user -p ${{ secrets.CONAN_GH_RUNNER_PASS }} -r cura-private-conan-dev "${{ secrets.CONAN_GH_RUNNER_USER }}"
 
       - name: Create the Packages
         run: conan install ${{ inputs.recipe_id_full }} --build=missing --update -c tools.build:skip_test=True
@@ -150,4 +153,4 @@ jobs:
 
       - name: Upload the Package(s) to the private Artifactory
         if: ${{ always() && ! inputs.conan_upload_community }}
-        run: conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c
+        run: conan upload ${{ inputs.recipe_id_full }} -r cura-private-conan-dev --all -c

+ 6 - 6
.github/workflows/conan-package.yml

@@ -41,12 +41,12 @@ on:
     branches:
       - main
       - 'CURA-*'
-      - '[1-9].[0-9]'
-      - '[1-9].[0-9][0-9]'
+      - '[0-9].[0-9]'
+      - '[0-9].[0-9][0-9]'
     tags:
-      - '[1-9].[0-9].[0-9]*'
-      - '[1-9].[0-9].[0-9]'
-      - '[1-9].[0-9][0-9].[0-9]*'
+      - '[0-9].[0-9].[0-9]*'
+      - '[0-9].[0-9].[0-9]'
+      - '[0-9].[0-9][0-9].[0-9]*'
 
 env:
   CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
@@ -102,7 +102,7 @@ jobs:
           sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
           sudo apt update
           sudo apt upgrade
-          sudo apt install efibootmgr build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config flex bison g++-12 gcc-12 -y
+          sudo apt install efibootmgr build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config flex bison libxcb-cursor-dev g++-12 gcc-12 -y
 
       - name: Install GCC-13
         run: |

+ 6 - 3
.github/workflows/conan-recipe-export.yml

@@ -80,7 +80,10 @@ jobs:
           conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
 
       - name: Add Cura private Artifactory remote
-        run: conan remote add cura-private https://ultimaker.jfrog.io/artifactory/api/conan/cura-private True
+        run: conan remote add cura-private-conan-dev https://cura.jfrog.io/artifactory/api/conan/cura-private-conan-dev True
+
+      - name: Set GH service account for remote cura-conan-dev
+        run: conan user -p ${{ secrets.CONAN_GH_RUNNER_PASS }} -r cura-private-conan-dev "${{ secrets.CONAN_GH_RUNNER_USER }}"
 
       - name: Export the Package (binaries)
         if: ${{ inputs.conan_export_binaries }}
@@ -103,5 +106,5 @@ jobs:
       - name: Upload the Package(s) to the private Artifactory
         if: ${{ always() && ! inputs.conan_upload_community }}
         run: |
-          conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c
-          conan upload ${{ inputs.recipe_id_latest }} -r cura-private -c
+          conan upload ${{ inputs.recipe_id_full }} -r cura-private-conan-dev --all -c
+          conan upload ${{ inputs.recipe_id_latest }} -r cura-private-conan-dev -c

+ 1 - 1
.github/workflows/linux.yml

@@ -111,7 +111,7 @@ jobs:
           sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
           sudo apt update
           sudo apt upgrade
-          sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync -y
+          sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf squashfs-tools strace util-linux zsync libxcb-cursor-dev -y
           
           # Get the AppImage tool
           wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool

+ 1 - 1
.github/workflows/macos.yml

@@ -145,7 +145,7 @@ jobs:
           p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }}
 
       - name: Remove private Artifactory
-        run: conan remote remove cura-conan-private || true
+        run: conan remote remove cura-private-conan-dev || true
 
       - name: Get Conan configuration
         run: |

+ 7 - 7
.github/workflows/windows.yml

@@ -140,13 +140,13 @@ jobs:
           .\cura_inst\Scripts\activate_github_actions_env.ps1
           .\cura_inst\Scripts\activate_github_actions_version_env.ps1
 
-      - name: Install OpenSSL shared
-        run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy
-
-      - name: Copy OpenSSL shared (Powershell)
-        run: |
-          cp openssl/bin/*.dll ./cura_inst/Scripts/
-          cp openssl/lib/*.lib ./cura_inst/Lib/
+#      - name: Install OpenSSL shared
+#        run: conan install openssl/1.1.1l@_/_ --build=missing --update -o openssl:shared=True -g deploy
+#
+#      - name: Copy OpenSSL shared (Powershell)
+#        run: |
+#          cp openssl/bin/*.dll ./cura_inst/Scripts/
+#          cp openssl/lib/*.lib ./cura_inst/Lib/
 
       - name: Create the Cura dist
         run: pyinstaller ./cura_inst/UltiMaker-Cura.spec

+ 4 - 3
README.md

@@ -12,7 +12,7 @@
 
 [![Badge Test]][Test]   
 [![Badge Conan]][Conan]   
-![Badge Downloads]
+[![Badge Downloads]][Downloads]
 <br>
 <br>
 
@@ -67,6 +67,7 @@
 [Issues]: https://github.com/Ultimaker/Cura/issues
 [Conan]: https://github.com/Ultimaker/Cura/actions/workflows/conan-package.yml
 [Test]: https://github.com/Ultimaker/Cura/actions/workflows/unit-test.yml
+[Downloads]: https://github.com/Ultimaker/Cura/releases/latest
 
 [License]: LICENSE
 [Report]: docs/Report.md
@@ -81,8 +82,8 @@
 [Badge License]: https://img.shields.io/badge/License-LGPL3-336887.svg?style=for-the-badge&labelColor=458cb5&logoColor=white&logo=GNU
 [Badge Closed]: https://img.shields.io/github/issues-closed/ultimaker/cura?style=for-the-badge&logoColor=white&labelColor=629944&color=446a30&logo=AddThis
 [Badge Issues]: https://img.shields.io/github/issues/ultimaker/cura?style=for-the-badge&logoColor=white&labelColor=c34360&color=933349&logo=AdBlock
-[Badge Conan]: https://img.shields.io/github/workflow/status/Ultimaker/Cura/conan-package?style=for-the-badge&logoColor=white&labelColor=6185aa&color=4c6987&logo=Conan&label=Conan%20Package
-[Badge Test]: https://img.shields.io/github/workflow/status/Ultimaker/Cura/unit-test?style=for-the-badge&logoColor=white&labelColor=4a999d&color=346c6e&logo=Codacy&label=Unit%20Test
+[Badge Conan]: https://img.shields.io/github/actions/workflow/status/Ultimaker/Cura/conan-package.yml?branch=main&style=for-the-badge&logoColor=white&labelColor=6185aa&color=4c6987&logo=Conan&label=Conan%20Package
+[Badge Test]: https://img.shields.io/github/actions/workflow/status/Ultimaker/Cura/unit-test.yml?branch=main&style=for-the-badge&logoColor=white&labelColor=4a999d&color=346c6e&logo=Codacy&label=Unit%20Test
 [Badge Size]: https://img.shields.io/github/repo-size/ultimaker/cura?style=for-the-badge&logoColor=white&labelColor=715a97&color=584674&logo=GoogleAnalytics
 [Badge Downloads]: https://img.shields.io/github/downloads-pre/Ultimaker/Cura/latest/total?style=for-the-badge
 

+ 23 - 13
conanfile.py

@@ -25,7 +25,7 @@ class CuraConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
 
     # FIXME: Remove specific branch once merged to main
-    python_requires = "translationextractor/[>=2.1.1]@ultimaker/stable"
+    python_requires = "translationextractor/[>=2.2.0]@ultimaker/stable"
 
     options = {
         "enterprise": ["True", "False", "true", "false"],  # Workaround for GH Action passing boolean as lowercase string
@@ -52,6 +52,10 @@ class CuraConan(ConanFile):
         if not self.version:
             self.version = "5.7.0-alpha"
 
+    @property
+    def _i18n_options(self):
+        return self.conf.get("user.i18n:options", default = {"extract": True, "build": True}, check_type = dict)
+
     @property
     def _pycharm_targets(self):
         return self.conan_data["pycharm_targets"]
@@ -257,7 +261,7 @@ class CuraConan(ConanFile):
         with open(os.path.join(self.recipe_folder, "UltiMaker-Cura.spec.jinja"), "r") as f:
             pyinstaller = Template(f.read())
 
-        version = self.conf_info.get("user.cura:version", default = self.version, check_type = str)
+        version = self.conf.get("user.cura:version", default = self.version, check_type = str)
         cura_version = Version(version)
 
         with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f:
@@ -310,7 +314,7 @@ class CuraConan(ConanFile):
             self.options["curaengine"].enable_sentry = True
 
     def validate(self):
-        version = self.conf_info.get("user.cura:version", default = self.version, check_type = str)
+        version = self.conf.get("user.cura:version", default = self.version, check_type = str)
         if version and Version(version) <= Version("4"):
             raise ConanInvalidConfiguration("Only versions 5+ are support")
 
@@ -321,7 +325,7 @@ class CuraConan(ConanFile):
         self.requires("zlib/1.2.13")
         self.requires("pyarcus/5.3.0")
         self.requires("dulcificum/0.1.0-beta.1")
-        self.requires("curaengine/(latest)@ultimaker/cura_11364")
+        self.requires("curaengine/(latest)@ultimaker/testing")
         self.requires("pysavitar/5.3.0")
         self.requires("pynest2d/5.3.0")
         self.requires("curaengine_plugin_gradual_flow/0.1.0")
@@ -336,7 +340,7 @@ class CuraConan(ConanFile):
 
     def build_requirements(self):
         if self.options.get_safe("enable_i18n", False):
-            self.tool_requires("gettext/0.21@ultimaker/testing", force_host_context = True)
+            self.tool_requires("gettext/0.21", force_host_context = True)
 
     def layout(self):
         self.folders.source = "."
@@ -398,12 +402,18 @@ class CuraConan(ConanFile):
 
         if self.options.devtools:
             entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements"))
-            self._generate_pyinstaller_spec(location = self.generators_folder,
-                                            entrypoint_location = "'{}'".format(os.path.join(self.source_folder, self.conan_data["pyinstaller"]["runinfo"]["entrypoint"])).replace("\\", "\\\\"),
-                                            icon_path = "'{}'".format(os.path.join(self.source_folder, "packaging", self.conan_data["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"),
-                                            entitlements_file = entitlements_file if self.settings.os == "Macos" else "None")
-
-        if self.options.get_safe("enable_i18n", False):
+            self._generate_pyinstaller_spec(
+                location=self.generators_folder,
+                entrypoint_location="'{}'".format(
+                    os.path.join(self.source_folder, self.conan_data["pyinstaller"]["runinfo"]["entrypoint"])).replace(
+                    "\\", "\\\\"),
+                icon_path="'{}'".format(os.path.join(self.source_folder, "packaging",
+                                                     self.conan_data["pyinstaller"]["icon"][
+                                                         str(self.settings.os)])).replace("\\", "\\\\"),
+                entitlements_file=entitlements_file if self.settings.os == "Macos" else "None"
+            )
+
+        if self.options.get_safe("enable_i18n", False) and self._i18n_options["extract"]:
             # Update the po and pot files
             vb = VirtualBuildEnv(self)
             vb.generate()
@@ -414,7 +424,7 @@ class CuraConan(ConanFile):
             pot.generate()
 
     def build(self):
-        if self.options.get_safe("enable_i18n", False):
+        if self.options.get_safe("enable_i18n", False) and self._i18n_options["build"]:
             for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
                 mo_file = Path(self.build_folder, po_file.with_suffix('.mo').relative_to(self.source_path))
                 mo_file = mo_file.parent.joinpath("LC_MESSAGES", mo_file.name)
@@ -438,7 +448,7 @@ class CuraConan(ConanFile):
         copy(self, "*", uranium.libdirs[0], str(self._site_packages.joinpath("UM")), keep_path = True)
 
         # Generate the GitHub Action version info Environment
-        version = self.conf_info.get("user.cura:version", default = self.version, check_type = str)
+        version = self.conf.get("user.cura:version", default = self.version, check_type = str)
         cura_version = Version(version)
         env_prefix = "Env:" if self.settings.os == "Windows" else ""
         activate_github_actions_version_env = Template(r"""echo "CURA_VERSION_MAJOR={{ cura_version_major }}" >> ${{ env_prefix }}GITHUB_ENV

+ 28 - 2
cura/BuildVolume.py

@@ -120,6 +120,8 @@ class BuildVolume(SceneNode):
 
         # Objects loaded at the moment. We are connected to the property changed events of these objects.
         self._scene_objects = set()  # type: Set[SceneNode]
+        # Number of toplevel printable meshes. If there is more than one, the build volume needs to take account of the gantry height in One at a Time printing.
+        self._root_printable_object_count = 0
 
         self._scene_change_timer = QTimer()
         self._scene_change_timer.setInterval(200)
@@ -151,6 +153,7 @@ class BuildVolume(SceneNode):
     def _onSceneChangeTimerFinished(self):
         root = self._application.getController().getScene().getRoot()
         new_scene_objects = set(node for node in BreadthFirstIterator(root) if node.callDecoration("isSliceable"))
+
         if new_scene_objects != self._scene_objects:
             for node in new_scene_objects - self._scene_objects: #Nodes that were added to the scene.
                 self._updateNodeListeners(node)
@@ -166,6 +169,26 @@ class BuildVolume(SceneNode):
             self.rebuild()
 
             self._scene_objects = new_scene_objects
+
+        # This also needs to be called when objects are grouped/ungrouped,
+        # which is not reflected in a change in self._scene_objects
+        self._updateRootPrintableObjectCount()
+
+    def _updateRootPrintableObjectCount(self):
+        # Get the number of models in the scene root, excluding modifier meshes and counting grouped models as 1
+        root = self._application.getController().getScene().getRoot()
+        scene_objects = set(node for node in BreadthFirstIterator(root) if node.callDecoration("isSliceable") or node.callDecoration("isGroup"))
+
+        new_root_printable_object_count = len(list(node for node in scene_objects if node.getParent() == root and not (
+            node_stack := node.callDecoration("getStack") and (
+                node.callDecoration("getStack").getProperty("anti_overhang_mesh", "value") or
+                node.callDecoration("getStack").getProperty("support_mesh", "value") or
+                node.callDecoration("getStack").getProperty("cutting_mesh", "value") or
+                node.callDecoration("getStack").getProperty("infill_mesh", "value")
+            ))
+        ))
+        if new_root_printable_object_count != self._root_printable_object_count:
+            self._root_printable_object_count = new_root_printable_object_count
             self._onSettingPropertyChanged("print_sequence", "value")  # Create fake event, so right settings are triggered.
 
     def _updateNodeListeners(self, node: SceneNode):
@@ -650,7 +673,7 @@ class BuildVolume(SceneNode):
 
             self._width = self._global_container_stack.getProperty("machine_width", "value")
             machine_height = self._global_container_stack.getProperty("machine_height", "value")
-            if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1:
+            if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time" and self._root_printable_object_count > 1:
                 new_height = min(self._global_container_stack.getProperty("gantry_height", "value") * self._scale_vector.z, machine_height)
 
                 if self._height > new_height:
@@ -692,9 +715,12 @@ class BuildVolume(SceneNode):
         update_extra_z_clearance = True
 
         for setting_key in self._changed_settings_since_last_rebuild:
+            if setting_key in ["print_sequence", "support_mesh", "infill_mesh", "cutting_mesh", "anti_overhang_mesh"]:
+                self._updateRootPrintableObjectCount()
+
             if setting_key == "print_sequence":
                 machine_height = self._global_container_stack.getProperty("machine_height", "value")
-                if self._application.getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1:
+                if self._application.getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time" and self._root_printable_object_count > 1:
                     new_height = min(
                         self._global_container_stack.getProperty("gantry_height", "value") * self._scale_vector.z,
                         machine_height)

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