Skip to content

Commit

Permalink
Merge branch 'main' into CURA-10831
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/conan-package-create.yml
#	.github/workflows/conan-package.yml
  • Loading branch information
jellespijker committed Nov 29, 2023
2 parents e1110dd + 319d478 commit 37a4c5d
Show file tree
Hide file tree
Showing 91 changed files with 12,336 additions and 17,874 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/SlicingCrash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/conan-recipe-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[![Badge Test]][Test]   
[![Badge Conan]][Conan]   
![Badge Downloads]
[![Badge Downloads]][Downloads]
<br>
<br>

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
18 changes: 11 additions & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -52,6 +52,10 @@ def set_version(self):
if not self.version:
self.version = self.conan_data["version"]

@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"]
Expand Down Expand Up @@ -257,7 +261,7 @@ def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, e
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:
Expand Down Expand Up @@ -308,7 +312,7 @@ def configure(self):
self.options["curaengine_grpc_definitions"].shared = 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")

Expand All @@ -329,7 +333,7 @@ def requirements(self):

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 = "."
Expand Down Expand Up @@ -402,7 +406,7 @@ def generate(self):
entitlements_file=entitlements_file if self.settings.os == "Macos" else "None"
)

if self.options.get_safe("enable_i18n", False):
if self.options.get_safe("enable_i18n", False) and self._i18n_options["extract"]:
# Update the po and pot files
vb = VirtualBuildEnv(self)
vb.generate()
Expand All @@ -413,7 +417,7 @@ def generate(self):
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)
Expand All @@ -437,7 +441,7 @@ def deploy(self):
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
Expand Down
30 changes: 28 additions & 2 deletions cura/BuildVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def __init__(self, application: "CuraApplication", parent: Optional[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)
Expand Down Expand Up @@ -151,6 +153,7 @@ def _onSceneChanged(self, source):
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)
Expand All @@ -166,6 +169,26 @@ def _onSceneChangeTimerFinished(self):
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):
Expand Down Expand Up @@ -650,7 +673,7 @@ def _onStackChangeTimerFinished(self) -> None:

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:
Expand Down Expand Up @@ -692,9 +715,12 @@ def _onSettingChangeTimerFinished(self) -> None:
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)
Expand Down
5 changes: 5 additions & 0 deletions cura/Machines/Models/IntentCategoryModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def _get_translations(cls):
"The annealing profile requires post-processing in an oven after the print is finished. This profile retains the dimensional accuracy of the printed part after annealing and improves strength, stiffness, and thermal resistance.")

}
cls._translations["solid"] = {
"name": catalog.i18nc("@label", "Solid"),
"description": catalog.i18nc("@text",
"A highly dense and strong part but at a slower print time. Great for functional parts.")
}
return cls._translations

def __init__(self, intent_category: str) -> None:
Expand Down
5 changes: 3 additions & 2 deletions cura/Machines/Models/IntentSelectionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def __init__(self, parent: Optional[QObject] = None) -> None:

self._onChange()

_default_intent_categories = ["default", "visual", "engineering", "quick", "annealing"]
_icons = {"default": "GearCheck", "visual": "Visual", "engineering": "Nut", "quick": "SpeedOMeter", "annealing": "Anneal"}
_default_intent_categories = ["default", "visual", "engineering", "quick", "annealing", "solid"]
_icons = {"default": "GearCheck", "visual": "Visual", "engineering": "Nut", "quick": "SpeedOMeter",
"annealing": "Anneal", "solid": "Hammer"}

def _onContainerChange(self, container: ContainerInterface) -> None:
"""Updates the list of intents if an intent profile was added or removed."""
Expand Down
5 changes: 5 additions & 0 deletions cura/Machines/Models/IntentTranslations.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
"name": catalog.i18nc("@label", "Draft"),
"description": catalog.i18nc("@text", "The draft profile is designed to print initial prototypes and concept validation with the intent of significant print time reduction.")
}
intent_translations["solid"] = {
"name": catalog.i18nc("@label", "Solid"),
"description": catalog.i18nc("@text",
"A highly dense and strong part but at a slower print time. Great for functional parts.")
}
21 changes: 12 additions & 9 deletions cura/Settings/DatabaseHandlers/VariantDatabaseHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ class VariantDatabaseHandler(DatabaseMetadataContainerController):
"""The Database handler for Variant containers"""

def __init__(self):
super().__init__(SQLQueryFactory(table = "variant",
fields = {
"id": "text",
"name": "text",
"hardware_type": "text",
"definition": "text",
"version": "text",
"setting_version": "text"
}))
super().__init__(SQLQueryFactory(
table="variant",
fields={
"id": "text",
"name": "text",
"hardware_type": "text",
"definition": "text",
"version": "text",
"setting_version": "text",
"reference_extruder_id": "text",
},
))
self._container_type = InstanceContainer
Loading

0 comments on commit 37a4c5d

Please sign in to comment.