Skip to content

Commit

Permalink
Merge pull request #19224 from Ultimaker/5.7-merge-to-main
Browse files Browse the repository at this point in the history
Get last 5.7 fixes
  • Loading branch information
rburema authored Jun 12, 2024
2 parents b0f5fee + af267af commit a935026
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 22 deletions.
32 changes: 19 additions & 13 deletions plugins/3MFWriter/ThreeMFWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def setStoreArchive(self, store_archive):
@staticmethod
def _convertUMNodeToSavitarNode(um_node,
transformation = Matrix(),
exported_settings: Optional[Dict[str, Set[str]]] = None):
exported_settings: Optional[Dict[str, Set[str]]] = None,
center_mesh = False):
"""Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode
:returns: Uranium Scene node.
Expand All @@ -111,16 +112,20 @@ def _convertUMNodeToSavitarNode(um_node,
savitar_node = Savitar.SceneNode()
savitar_node.setName(um_node.getName())

node_matrix = Matrix()
mesh_data = um_node.getMeshData()
# compensate for original center position, if object(s) is/are not around its zero position
if mesh_data is not None:
extents = mesh_data.getExtents()
if extents is not None:
# We use a different coordinate space while writing, so flip Z and Y
center_vector = Vector(extents.center.x, extents.center.z, extents.center.y)
node_matrix.setByTranslation(center_vector)
node_matrix.multiply(um_node.getLocalTransformation())

if center_mesh:
node_matrix = Matrix()
# compensate for original center position, if object(s) is/are not around its zero position
if mesh_data is not None:
extents = mesh_data.getExtents()
if extents is not None:
# We use a different coordinate space while writing, so flip Z and Y
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
node_matrix.setByTranslation(center_vector)
node_matrix.multiply(um_node.getLocalTransformation())
else:
node_matrix = um_node.getLocalTransformation()

matrix_string = ThreeMFWriter._convertMatrixToString(node_matrix.preMultiply(transformation))

Expand All @@ -147,7 +152,7 @@ def _convertUMNodeToSavitarNode(um_node,
for key in changed_setting_keys:
savitar_node.setSetting("cura:" + key, str(stack.getProperty(key, "value")))
else:
# We want to export only the specified settings
# We want to export only the specified settings
if um_node.getName() in exported_settings:
model_exported_settings = exported_settings[um_node.getName()]

Expand Down Expand Up @@ -283,7 +288,8 @@ def write(self, stream, nodes, mode = MeshWriter.OutputMode.BinaryMode, export_s
for root_child in node.getChildren():
savitar_node = ThreeMFWriter._convertUMNodeToSavitarNode(root_child,
transformation_matrix,
exported_model_settings)
exported_model_settings,
center_mesh = True)
if savitar_node:
savitar_scene.addSceneNode(savitar_node)
else:
Expand Down Expand Up @@ -442,7 +448,7 @@ def _createSnapshot(self):
def sceneNodesToString(scene_nodes: [SceneNode]) -> str:
savitar_scene = Savitar.Scene()
for scene_node in scene_nodes:
savitar_node = ThreeMFWriter._convertUMNodeToSavitarNode(scene_node)
savitar_node = ThreeMFWriter._convertUMNodeToSavitarNode(scene_node, center_mesh = True)
savitar_scene.addSceneNode(savitar_node)
parser = Savitar.ThreeMFParser()
scene_string = parser.sceneToString(savitar_scene)
Expand Down
2 changes: 1 addition & 1 deletion plugins/CuraEngineBackend/CuraEngineBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def _onStartSliceCompleted(self, job: StartSliceJob) -> None:

if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder:
self._error_message = Message(catalog.i18nc("@info:status",
"Unable to slice because there are objects associated with disabled Extruder %s.") % job.getMessage(),
"Unable to slice because there are objects associated with disabled Extruder %s.") % job.getAssociatedDisabledExtruders(),
title = catalog.i18nc("@info:title", "Unable to slice"),
message_type = Message.MessageType.WARNING)
self._error_message.show()
Expand Down
6 changes: 5 additions & 1 deletion plugins/CuraEngineBackend/StartSliceJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,17 @@ def __init__(self, slice_message: Arcus.PythonMessage) -> None:
self._slice_message: Arcus.PythonMessage = slice_message
self._is_cancelled: bool = False
self._build_plate_number: Optional[int] = None
self._associated_disabled_extruders: Optional[str] = None

# cache for all setting values from all stacks (global & extruder) for the current machine
self._all_extruders_settings: Optional[Dict[str, Any]] = None

def getSliceMessage(self) -> Arcus.PythonMessage:
return self._slice_message

def getAssociatedDisabledExtruders(self) -> Optional[str]:
return self._associated_disabled_extruders

def setBuildPlate(self, build_plate_number: int) -> None:
self._build_plate_number = build_plate_number

Expand Down Expand Up @@ -334,7 +338,7 @@ def run(self) -> None:
if has_model_with_disabled_extruders:
self.setResult(StartJobResult.ObjectsWithDisabledExtruder)
associated_disabled_extruders = {p + 1 for p in associated_disabled_extruders}
self.setMessage(", ".join(map(str, sorted(associated_disabled_extruders))))
self._associated_disabled_extruders = ", ".join(map(str, sorted(associated_disabled_extruders)))
return

# There are cases when there is nothing to slice. This can happen due to one at a time slicing not being
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ chardet==3.0.4 \
idna==2.8 \
--hash=sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407 \
--hash=sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c
attrs==21.2.0 \
--hash=sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1 \
--hash=sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb
attrs==21.3.0 \
--hash=sha256:8f7335278dedd26b58c38e006338242cc0977f06d51579b2b8b87b9b33bff66c \
--hash=sha256:50f3c9b216dc9021042f71b392859a773b904ce1a029077f58f6598272432045
requests==2.22.0 \
--hash=sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4 \
--hash=sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31
Expand All @@ -222,9 +222,9 @@ constantly==15.1.0 \
hyperlink==21.0.0 \
--hash=sha256:427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b \
--hash=sha256:e6b14c37ecb73e89c77d78cdb4c2cc8f3fb59a885c5b3f819ff4ed80f25af1b4
incremental==21.3.0 \
--hash=sha256:02f5de5aff48f6b9f665d99d48bfc7ec03b6e3943210de7cfc88856d755d6f57 \
--hash=sha256:92014aebc6a20b78a8084cdd5645eeaa7f74b8933f70fa3ada2cfbd1e3b54321
incremental==22.10.0 \
--hash=sha256:b864a1f30885ee72c5ac2835a761b8fe8aa9c28b9395cacf27286602688d3e51 \
--hash=sha256:912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0
zope.interface==5.4.0 \
--hash=sha256:0f91b5b948686659a8e28b728ff5e74b1be6bf40cb04704453617e5f1e945ef3 \
--hash=sha256:3c02411a3b62668200910090a0dff17c0b25aaa36145082a5a6adf08fa281e54 \
Expand Down
6 changes: 5 additions & 1 deletion resources/definitions/fdmprinter.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -6208,6 +6208,7 @@
"type": "bool",
"default_value": false,
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
"resolve": "any(extruderValues('raft_remove_inside_corners'))",
"settable_per_mesh": false,
"settable_per_extruder": false,
"children":
Expand All @@ -6220,6 +6221,7 @@
"value": "raft_remove_inside_corners",
"default_value": false,
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
"resolve": "any(extruderValues('raft_base_remove_inside_corners'))",
"settable_per_mesh": false,
"settable_per_extruder": false
},
Expand All @@ -6231,6 +6233,7 @@
"value": "raft_remove_inside_corners",
"default_value": false,
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
"resolve": "any(extruderValues('raft_interface_remove_inside_corners'))",
"settable_per_mesh": false,
"settable_per_extruder": false
},
Expand All @@ -6242,6 +6245,7 @@
"value": "raft_remove_inside_corners",
"default_value": false,
"enabled": "resolveOrValue('adhesion_type') == 'raft'",
"resolve": "any(extruderValues('raft_surface_remove_inside_corners'))",
"settable_per_mesh": false,
"settable_per_extruder": false
}
Expand Down Expand Up @@ -6845,7 +6849,7 @@
"label": "Prime Tower Type",
"description": "<html>How to generate the prime tower:<ul><li><b>Normal:</b> create a bucket in which secondary materials are primed</li><li><b>Interleaved:</b> create a prime tower as sparse as possible. This will save time and filament, but is only possible if the used materials adhere to each other</li></ul></html>",
"type": "enum",
"resolve": "'interleaved' if (all(material_type_var == extruderValues('material_type')[0] for material_type_var in extruderValues('material_type')) and all(material_brand_var == extruderValues('material_brand')[0] for material_brand_var in extruderValues('material_brand'))) else 'normal'",
"resolve": "'interleaved' if all(mode == 'interleaved' for mode in extruderValues('prime_tower_mode')) else 'interleaved' if (all(material_type_var == extruderValues('material_type')[0] for material_type_var in extruderValues('material_type')) and all(material_brand_var == extruderValues('material_brand')[0] for material_brand_var in extruderValues('material_brand'))) else 'normal'",
"options":
{
"normal": "Normal",
Expand Down
1 change: 1 addition & 0 deletions resources/definitions/ultimaker.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"maximum_value_warning": "120",
"minimum_value": "0"
},
"material_print_temp_wait": { "value": false },
"material_print_temperature": { "minimum_value": "0" },
"material_standby_temperature":
{
Expand Down
10 changes: 10 additions & 0 deletions resources/texts/change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
[5.7.2]

* Bugfixes
- Fixed a bug where modifier meshes and support meshes were not loaded in the correct position, should resolve https://github.com/Ultimaker/Cura/issues/18761 (and https://github.com/5axes/SpoonAntiWarping/issues/8)
- Primeblobs were not printed for a second extruder
- Interleaved prime tower can now be printed with a raft
- Improved behaviors for start temperature for multiple extruders
- Improved preheating logic when using a raft with multiple extruders
- Enabled Raft Remove Inside Corners and Prime Tower Mode to be shipped with a material profile

[5.7.1]

* Introducing the UltiMaker Factor 4
Expand Down

0 comments on commit a935026

Please sign in to comment.