diff options
-rwxr-xr-x | cura/CuraApplication.py | 1 | ||||
-rw-r--r-- | cura/OAuth2/AuthorizationService.py | 6 | ||||
-rw-r--r-- | cura/Scene/CuraSceneNode.py | 1 | ||||
-rw-r--r-- | plugins/DigitalLibrary/src/DigitalFactoryController.py | 5 | ||||
-rw-r--r-- | plugins/PostProcessingPlugin/scripts/FilamentChange.py | 17 | ||||
-rwxr-xr-x | plugins/SliceInfoPlugin/SliceInfo.py | 5 | ||||
-rw-r--r-- | plugins/SliceInfoPlugin/example_data.html | 1 |
7 files changed, 32 insertions, 4 deletions
diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c72ad0ae90..ea9eb97376 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1863,6 +1863,7 @@ class CuraApplication(QtApplication): else: node = CuraSceneNode() node.setMeshData(original_node.getMeshData()) + node.source_mime_type = original_node.source_mime_type # Setting meshdata does not apply scaling. if original_node.getScale() != Vector(1.0, 1.0, 1.0): diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index da654b52bb..96091f9c11 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -113,8 +113,10 @@ class AuthorizationService: # The token could not be refreshed using the refresh token. We should login again. return None # Ensure it gets stored as otherwise we only have it in memory. The stored refresh token has been deleted - # from the server already. - self._storeAuthData(self._auth_data) + # from the server already. Do not store the auth_data if we could not get new auth_data (eg due to a + # network error), since this would cause an infinite loop trying to get new auth-data + if self._auth_data.success: + self._storeAuthData(self._auth_data) return self._auth_helpers.parseJWT(self._auth_data.access_token) def getAccessToken(self) -> Optional[str]: diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py index 9b5c432b36..ec832b8ec7 100644 --- a/cura/Scene/CuraSceneNode.py +++ b/cura/Scene/CuraSceneNode.py @@ -143,6 +143,7 @@ class CuraSceneNode(SceneNode): copy.setTransformation(self.getLocalTransformation(copy= False)) copy.setMeshData(self._mesh_data) copy.setVisible(cast(bool, deepcopy(self._visible, memo))) + copy.source_mime_type = cast(str, deepcopy(self.source_mime_type, memo)) copy._selectable = cast(bool, deepcopy(self._selectable, memo)) copy._name = cast(str, deepcopy(self._name, memo)) for decorator in self._decorators: diff --git a/plugins/DigitalLibrary/src/DigitalFactoryController.py b/plugins/DigitalLibrary/src/DigitalFactoryController.py index 8f65faa2a3..352a8c70f2 100644 --- a/plugins/DigitalLibrary/src/DigitalFactoryController.py +++ b/plugins/DigitalLibrary/src/DigitalFactoryController.py @@ -385,6 +385,11 @@ class DigitalFactoryController(QObject): def _applicationInitializationFinished(self) -> None: self._supported_file_types = self._application.getInstance().getMeshFileHandler().getSupportedFileTypesRead() + # Although Cura supports these, it's super confusing in this context to show them. + for extension in ["jpg", "jpeg", "png", "bmp", "gif"]: + if extension in self._supported_file_types: + del self._supported_file_types[extension] + @pyqtSlot() def openSelectedFiles(self) -> None: """ Downloads, then opens all files selected in the Qt frontend open dialog. diff --git a/plugins/PostProcessingPlugin/scripts/FilamentChange.py b/plugins/PostProcessingPlugin/scripts/FilamentChange.py index 5e984a2cd1..17ff045b8d 100644 --- a/plugins/PostProcessingPlugin/scripts/FilamentChange.py +++ b/plugins/PostProcessingPlugin/scripts/FilamentChange.py @@ -72,6 +72,15 @@ class FilamentChange(Script): "type": "float", "default_value": 0, "enabled": "not firmware_config" + }, + "z_position": + { + "label": "Z Position (relative)", + "description": "Extruder relative Z position. Move the print head up for filament change.", + "unit": "mm", + "type": "float", + "default_value": 0, + "minimum_value": 0 } } }""" @@ -87,6 +96,7 @@ class FilamentChange(Script): later_retract = self.getSettingValueByKey("later_retract") x_pos = self.getSettingValueByKey("x_position") y_pos = self.getSettingValueByKey("y_position") + z_pos = self.getSettingValueByKey("z_position") firmware_config = self.getSettingValueByKey("firmware_config") color_change = "M600" @@ -100,10 +110,13 @@ class FilamentChange(Script): if x_pos is not None: color_change = color_change + (" X%.2f" % x_pos) - + if y_pos is not None: color_change = color_change + (" Y%.2f" % y_pos) + if z_pos is not None and z_pos > 0.: + color_change = color_change + (" Z%.2f" % z_pos) + color_change = color_change + " ; Generated by FilamentChange plugin\n" layer_targets = layer_nums.split(",") @@ -116,4 +129,4 @@ class FilamentChange(Script): if 0 < layer_num < len(data): data[layer_num] = color_change + data[layer_num] - return data
\ No newline at end of file + return data diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 6eed649cc7..5ead422d0a 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -229,6 +229,11 @@ class SliceInfo(QObject, Extension): model["model_settings"] = model_settings + if node.source_mime_type is None: + model["mime_type"] = "" + else: + model["mime_type"] = node.source_mime_type.name + data["models"].append(model) print_times = print_information.printTimes() diff --git a/plugins/SliceInfoPlugin/example_data.html b/plugins/SliceInfoPlugin/example_data.html index b349ec328d..5b97f1cba6 100644 --- a/plugins/SliceInfoPlugin/example_data.html +++ b/plugins/SliceInfoPlugin/example_data.html @@ -54,6 +54,7 @@ <li><b>Bounding Box:</b> [minimum x, y, z; maximum x, y, z]</li> <li><b>Is Helper Mesh:</b> no</li> <li><b>Helper Mesh Type:</b> support mesh</li> + <li><b>File type:</b> STL</li> </ul> </li> </ul> |