Skip to content

Commit

Permalink
Merge branch 'main' into CURA-10475_engineplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jellespijker committed Jul 5, 2023
2 parents 9aa098f + 648b26a commit 0d1bb07
Show file tree
Hide file tree
Showing 102 changed files with 1,379 additions and 2,704 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/cura-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,28 @@ jobs:
with open(summary_env, "w") as f:
f.write(content)
f.writelines("# ${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }} uses:\n")
f.writelines("# ${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}\n")
f.writelines("## Conan packages:\n")
for dep in sorted_deps:
f.writelines(f"`{dep}`\n")
- name: Summarize the used Python modules
shell: python
run: |
import os
import pkg_resources
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
if os.path.exists(summary_env):
with open(summary_env, "r") as f:
content = f.read()
with open(summary_env, "w") as f:
f.write(content)
f.writelines("## Python modules:\n")
for package in pkg_resources.working_set:
f.writelines(f"`{package.key}/{package.version}`\n")
- name: Archive the artifacts (bash)
if: ${{ !inputs.installer && runner.os != 'Windows' }}
run: tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./UltiMaker-Cura/"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ jobs:
exempt-issue-labels: 'Status: Triage,Developer Environment :computer:,Status: On Backlog,PR: Community Contribution :crown:,PR: Printer Definitions :factory:,PR: Translations :books:'
stale-issue-label: 'Status: Stale :hourglass:'
labels-to-add-when-unstale: 'Status: Triage'
only-labels: "Type: Bug,Status: Deferred"
only-labels: "Type: New Feature,Status: Deferred"
stale-issue-message: |
Hi 👋,
We are cleaning our list of issues to improve our focus.
This bug seems to be older than a year, which is at least three major Cura releases ago.
This feature request seems to be older than a year, which is at least three major Cura releases ago.
It also received the label Deferred indicating that we did not have time to work on it back then and haven't found time to work on it since.
If this is still a problem for you in the current version of Cura, can you please leave a comment?
If this is still something that you think can improve how you and others use Cura, can you please leave a comment?
We will have a fresh set of eyes to look at it.
If it is not a problem anymore, you don't have to do anything, and this issue will be automatically closed in 14 days.
If it has been resolved or don't need it to be improved anymore, you don't have to do anything, and this issue will be automatically closed in 14 days.
close-issue-message: |
This issue was closed because it has been inactive for 14 days since being marked as stale.
If you encounter this issue and still experience this to be a problem, you are welcome to make a fresh new issue with an updated description and screenshots.
If you encounter this issue and still have a need for this, you are welcome to make a fresh new issue with an updated description.
permissions:
contents: write # only for delete-branch option
issues: write
Expand Down
2 changes: 1 addition & 1 deletion cura/ApplicationMetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Each release has a fixed SDK version coupled with it. It doesn't make sense to make it configurable because, for
# example Cura 3.2 with SDK version 6.1 will not work. So the SDK version is hard-coded here and left out of the
# CuraVersion.py.in template.
CuraSDKVersion = "8.3.0"
CuraSDKVersion = "8.4.0"

try:
from cura.CuraVersion import CuraLatestURL
Expand Down
1 change: 1 addition & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def _initializeSettingFunctions(self):

SettingFunction.registerOperator("extruderValue", self._cura_formula_functions.getValueInExtruder)
SettingFunction.registerOperator("extruderValues", self._cura_formula_functions.getValuesInAllExtruders)
SettingFunction.registerOperator("anyExtruderNrWithOrDefault", self._cura_formula_functions.getAnyExtruderPositionWithOrDefault)
SettingFunction.registerOperator("resolveOrValue", self._cura_formula_functions.getResolveOrValue)
SettingFunction.registerOperator("defaultExtruderPosition", self._cura_formula_functions.getDefaultExtruderPosition)
SettingFunction.registerOperator("valueFromContainer", self._cura_formula_functions.getValueFromContainerAtIndex)
Expand Down
10 changes: 9 additions & 1 deletion cura/Machines/MachineNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from cura.Machines.QualityGroup import QualityGroup # To construct groups of quality profiles that belong together.
from cura.Machines.QualityNode import QualityNode
from cura.Machines.VariantNode import VariantNode
from cura.Machines.MaterialNode import MaterialNode
import UM.FlameProfiler


Expand Down Expand Up @@ -167,13 +168,20 @@ def preferredGlobalQuality(self) -> "QualityNode":

return self.global_qualities.get(self.preferred_quality_type, next(iter(self.global_qualities.values())))

def isExcludedMaterial(self, material: MaterialNode) -> bool:
"""Returns whether the material should be excluded from the list of materials."""
for exclude_material in self.exclude_materials:
if exclude_material in material["id"]:
return True
return False

@UM.FlameProfiler.profile
def _loadAll(self) -> None:
"""(Re)loads all variants under this printer."""

container_registry = ContainerRegistry.getInstance()
if not self.has_variants:
self.variants["empty"] = VariantNode("empty_variant", machine = self)
self.variants["empty"] = VariantNode("empty_variant", machine=self)
self.variants["empty"].materialsChanged.connect(self.materialsChanged)
else:
# Find all the variants for this definition ID.
Expand Down
15 changes: 11 additions & 4 deletions cura/Machines/Models/IntentSelectionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,21 @@ def _update(self) -> None:
.findContainersMetadata(type="intent", definition=global_stack.definition.getId(),
intent_category=category)[0]

intent_name = intent_metadata.get("name", category.title())
icon = intent_metadata.get("icon", None)
description = intent_metadata.get("description", None)

if icon is not None:
icon = QUrl.fromLocalFile(
Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.ImageFiles, icon))
try:
icon = QUrl.fromLocalFile(
Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.ImageFiles, icon))
except (FileNotFoundError, NotADirectoryError, PermissionError):
Logger.log("e", f"Icon file for intent {intent_name} not found.")
icon = None

result.append({
"name": intent_metadata.get("name", category.title()),
"description": intent_metadata.get("description", None),
"name": intent_name,
"description": description,
"custom_icon": icon,
"icon": None,
"intent_category": category,
Expand Down
2 changes: 1 addition & 1 deletion cura/Machines/VariantNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _loadAll(self) -> None:
materials = list(materials_per_base_file.values())

# Filter materials based on the exclude_materials property.
filtered_materials = [material for material in materials if material["id"] not in self.machine.exclude_materials]
filtered_materials = [material for material in materials if not self.machine.isExcludedMaterial(material)]

for material in filtered_materials:
base_file = material["base_file"]
Expand Down
24 changes: 21 additions & 3 deletions cura/Settings/CuraFormulaFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def getValueInExtruder(self, extruder_position: int, property_key: str,

return value

# Gets all extruder values as a list for the given property.
def getValuesInAllExtruders(self, property_key: str,
context: Optional["PropertyEvaluationContext"] = None) -> List[Any]:
def _getActiveExtruders(self, context: Optional["PropertyEvaluationContext"] = None) -> List[str]:
machine_manager = self._application.getMachineManager()
extruder_manager = self._application.getExtruderManager()

Expand All @@ -73,7 +71,17 @@ def getValuesInAllExtruders(self, property_key: str,
# only include values from extruders that are "active" for the current machine instance
if int(extruder.getMetaDataEntry("position")) >= global_stack.getProperty("machine_extruder_count", "value", context = context):
continue
result.append(extruder)

return result

# Gets all extruder values as a list for the given property.
def getValuesInAllExtruders(self, property_key: str,
context: Optional["PropertyEvaluationContext"] = None) -> List[Any]:
global_stack = self._application.getMachineManager().activeMachine

result = []
for extruder in self._getActiveExtruders(context):
value = extruder.getRawProperty(property_key, "value", context = context)

if value is None:
Expand All @@ -89,6 +97,16 @@ def getValuesInAllExtruders(self, property_key: str,

return result

# Get the first extruder that adheres to a specific (boolean) property, like 'material_is_support_material'.
def getAnyExtruderPositionWithOrDefault(self, filter_key: str,
context: Optional["PropertyEvaluationContext"] = None) -> str:
for extruder in self._getActiveExtruders(context):
value = extruder.getRawProperty(filter_key, "value", context=context)
if value is None or not value:
continue
return str(extruder.position)
return self.getDefaultExtruderPosition()

# Get the resolve value or value for a given key.
def getResolveOrValue(self, property_key: str, context: Optional["PropertyEvaluationContext"] = None) -> Any:
machine_manager = self._application.getMachineManager()
Expand Down
3 changes: 2 additions & 1 deletion docs/profiles/getting_a_setting_value.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ There are also a few extra things that can be used in these expressions:
* The function `extruderValue(extruder, key)` will evaluate a particular setting for a particular extruder.
* The function `resolveOrValue(key)` will perform the full setting evaluation as described in this document for the current context (so if this setting is being evaluated for the second extruder it would perform it as if coming from the second extruder).
* The function `defaultExtruderPosition()` will get the first extruder that is not disabled. For instance, if a printer has three extruders but the first is disabled, this would return `1` to indicate the second extruder (0-indexed).
* The function `anyExtruderNrWithOrDefault(key)` will filter the list of extruders on the key, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above.
* The function `valueFromContainer(key, index)` will get a setting value from the global stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack.
* The function `valueFromExtruderContainer(key, index)` will get a setting value from the current extruder stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack.
* The function `extruderValueFromContainer(key, index)` will get a setting value from the current extruder stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack.

CuraEngine
----
Expand Down
91 changes: 23 additions & 68 deletions plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ Item

onActivated:
{
if (index == 0){
setMeshType(infillMeshType)
} else {
setMeshType(cuttingMeshType)
}
setMeshType(index === 0 ? infillMeshType : cuttingMeshType);
}

Binding
Expand Down Expand Up @@ -204,21 +200,21 @@ Item
model: UM.SettingDefinitionsModel
{
id: addedSettingsModel
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
expanded: [ "*" ]
containerId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.id: ""
expanded: ["*"]
filter:
{
if (printSequencePropertyProvider.properties.value == "one_at_a_time")
if (printSequencePropertyProvider.properties.value === "one_at_a_time")
{
return {"settable_per_meshgroup": true}
return { settable_per_meshgroup: true }
}
return {"settable_per_mesh": true}
return { settable_per_meshgroup: true }
}
exclude:
{
var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
const excluded_settings = ["support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh"]

if (currentMeshType == "support_mesh")
if (currentMeshType === "support_mesh")
{
excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
}
Expand Down Expand Up @@ -246,7 +242,6 @@ Item
{
id: settingLoader
width: UM.Theme.getSize("setting").width - removeButton.width - scrollBar.width
height: UM.Theme.getSize("section").height + UM.Theme.getSize("narrow_margin").height
enabled: provider.properties.enabled === "True"
property var definition: model
property var settingDefinitionsModel: addedSettingsModel
Expand All @@ -257,7 +252,7 @@ Item
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
asynchronous: model.type != "enum" && model.type != "extruder"
asynchronous: model.type !== "enum" && model.type !== "extruder"

onLoaded:
{
Expand All @@ -266,6 +261,7 @@ Item
settingLoader.item.showLinkedSettingIcon = false
settingLoader.item.doDepthIndentation = false
settingLoader.item.doQualityUserSettingEmphasis = false
settingLoader.item.height = UM.Theme.getSize("setting").height + UM.Theme.getSize("narrow_margin").height
}

sourceComponent:
Expand Down Expand Up @@ -362,11 +358,11 @@ Item
if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
{
const containerId = UM.ActiveTool.properties.getValue("ContainerID")
if (provider.containerStackId != containerId)
if (provider.containerStackId !== containerId)
{
provider.containerStackId = containerId
}
if (inheritStackProvider.containerStackId != containerId)
if (inheritStackProvider.containerStackId !== containerId)
{
inheritStackProvider.containerStackId = containerId
}
Expand All @@ -388,13 +384,13 @@ Item
onClicked:
{
settingPickDialog.visible = true;
if (currentMeshType == "support_mesh")
if (currentMeshType === "support_mesh")
{
settingPickDialog.additional_excluded_settings = base.allCategoriesExceptSupport;
}
else
{
settingPickDialog.additional_excluded_settings = []
settingPickDialog.additional_excluded_settings = [];
}
}
}
Expand All @@ -412,7 +408,7 @@ Item

containerStack: Cura.MachineManager.activeMachine
key: "machine_extruder_count"
watchedProperties: [ "value" ]
watchedProperties: ["value"]
storeIndex: 0
}

Expand All @@ -422,56 +418,15 @@ Item

containerStack: Cura.MachineManager.activeMachine
key: "print_sequence"
watchedProperties: [ "value" ]
watchedProperties: ["value"]
storeIndex: 0
}

Component
{
id: settingTextField

Cura.SettingTextField { }
}

Component
{
id: settingComboBox

Cura.SettingComboBox { }
}

Component
{
id: settingExtruder

Cura.SettingExtruder { }
}

Component
{
id: settingOptionalExtruder

Cura.SettingOptionalExtruder { }
}

Component
{
id: settingCheckBox

Cura.SettingCheckBox { }
}

Component
{
id: settingCategory

Cura.SettingCategory { }
}

Component
{
id: settingUnknown

Cura.SettingUnknown { }
}
Component { id: settingTextField; Cura.SettingTextField { } }
Component { id: settingComboBox; Cura.SettingComboBox { } }
Component { id: settingExtruder; Cura.SettingExtruder { } }
Component { id: settingOptionalExtruder; Cura.SettingOptionalExtruder { } }
Component { id: settingCheckBox; Cura.SettingCheckBox { } }
Component { id: settingCategory; Cura.SettingCategory { } }
Component { id: settingUnknown; Cura.SettingUnknown { } }
}
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/scripts/PauseAtHeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def execute(self, data: List[str]) -> List[str]:
nbr_negative_layers += 1

#Track the latest printing temperature in order to resume at the correct temperature.
if line.startswith("T"):
if re.match("T(\d*)", line):
current_t = self.getValue(line, "T")
m = self.getValue(line, "M")
if m is not None and (m == 104 or m == 109) and self.getValue(line, "S") is not None:
Expand Down
Loading

0 comments on commit 0d1bb07

Please sign in to comment.