Skip to content

Commit 8e12d49

Browse files
committed
Merge branch 'master' of github.com:Ultimaker/Cura
2 parents 48d1715 + 6ec61a6 commit 8e12d49

File tree

7 files changed

+32
-4
lines changed

7 files changed

+32
-4
lines changed

cura/CuraApplication.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,7 @@ def _readMeshFinished(self, job):
18631863
else:
18641864
node = CuraSceneNode()
18651865
node.setMeshData(original_node.getMeshData())
1866+
node.source_mime_type = original_node.source_mime_type
18661867

18671868
# Setting meshdata does not apply scaling.
18681869
if original_node.getScale() != Vector(1.0, 1.0, 1.0):

cura/OAuth2/AuthorizationService.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ def _parseJWT(self) -> Optional["UserProfile"]:
113113
# The token could not be refreshed using the refresh token. We should login again.
114114
return None
115115
# Ensure it gets stored as otherwise we only have it in memory. The stored refresh token has been deleted
116-
# from the server already.
117-
self._storeAuthData(self._auth_data)
116+
# from the server already. Do not store the auth_data if we could not get new auth_data (eg due to a
117+
# network error), since this would cause an infinite loop trying to get new auth-data
118+
if self._auth_data.success:
119+
self._storeAuthData(self._auth_data)
118120
return self._auth_helpers.parseJWT(self._auth_data.access_token)
119121

120122
def getAccessToken(self) -> Optional[str]:

cura/Scene/CuraSceneNode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def __deepcopy__(self, memo: Dict[int, object]) -> "CuraSceneNode":
143143
copy.setTransformation(self.getLocalTransformation(copy= False))
144144
copy.setMeshData(self._mesh_data)
145145
copy.setVisible(cast(bool, deepcopy(self._visible, memo)))
146+
copy.source_mime_type = cast(str, deepcopy(self.source_mime_type, memo))
146147
copy._selectable = cast(bool, deepcopy(self._selectable, memo))
147148
copy._name = cast(str, deepcopy(self._name, memo))
148149
for decorator in self._decorators:

plugins/DigitalLibrary/src/DigitalFactoryController.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ def _onEngineCreated() -> None:
385385
def _applicationInitializationFinished(self) -> None:
386386
self._supported_file_types = self._application.getInstance().getMeshFileHandler().getSupportedFileTypesRead()
387387

388+
# Although Cura supports these, it's super confusing in this context to show them.
389+
for extension in ["jpg", "jpeg", "png", "bmp", "gif"]:
390+
if extension in self._supported_file_types:
391+
del self._supported_file_types[extension]
392+
388393
@pyqtSlot()
389394
def openSelectedFiles(self) -> None:
390395
""" Downloads, then opens all files selected in the Qt frontend open dialog.

plugins/PostProcessingPlugin/scripts/FilamentChange.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ def getSettingDataString(self):
7272
"type": "float",
7373
"default_value": 0,
7474
"enabled": "not firmware_config"
75+
},
76+
"z_position":
77+
{
78+
"label": "Z Position (relative)",
79+
"description": "Extruder relative Z position. Move the print head up for filament change.",
80+
"unit": "mm",
81+
"type": "float",
82+
"default_value": 0,
83+
"minimum_value": 0
7584
}
7685
}
7786
}"""
@@ -87,6 +96,7 @@ def execute(self, data: List[str]):
8796
later_retract = self.getSettingValueByKey("later_retract")
8897
x_pos = self.getSettingValueByKey("x_position")
8998
y_pos = self.getSettingValueByKey("y_position")
99+
z_pos = self.getSettingValueByKey("z_position")
90100
firmware_config = self.getSettingValueByKey("firmware_config")
91101

92102
color_change = "M600"
@@ -100,10 +110,13 @@ def execute(self, data: List[str]):
100110

101111
if x_pos is not None:
102112
color_change = color_change + (" X%.2f" % x_pos)
103-
113+
104114
if y_pos is not None:
105115
color_change = color_change + (" Y%.2f" % y_pos)
106116

117+
if z_pos is not None and z_pos > 0.:
118+
color_change = color_change + (" Z%.2f" % z_pos)
119+
107120
color_change = color_change + " ; Generated by FilamentChange plugin\n"
108121

109122
layer_targets = layer_nums.split(",")
@@ -116,4 +129,4 @@ def execute(self, data: List[str]):
116129
if 0 < layer_num < len(data):
117130
data[layer_num] = color_change + data[layer_num]
118131

119-
return data
132+
return data

plugins/SliceInfoPlugin/SliceInfo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ def _onWriteStarted(self, output_device):
229229

230230
model["model_settings"] = model_settings
231231

232+
if node.source_mime_type is None:
233+
model["mime_type"] = ""
234+
else:
235+
model["mime_type"] = node.source_mime_type.name
236+
232237
data["models"].append(model)
233238

234239
print_times = print_information.printTimes()

plugins/SliceInfoPlugin/example_data.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ <h3>Model Information:</h3>
5454
<li><b>Bounding Box:</b> [minimum x, y, z; maximum x, y, z]</li>
5555
<li><b>Is Helper Mesh:</b> no</li>
5656
<li><b>Helper Mesh Type:</b> support mesh</li>
57+
<li><b>File type:</b> STL</li>
5758
</ul>
5859
</li>
5960
</ul>

0 commit comments

Comments
 (0)