diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-06-15 16:32:44 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-06-15 16:32:44 +0300 |
commit | cfd0bde6b15c0095ec40e1eea231166af1e1fa2d (patch) | |
tree | 6ad956fd12d61b5a621c7166dab9abee35bf992e /plugins/SupportEraser | |
parent | 797d05947cfa6020416b93f5b38e5ed079d4a8c0 (diff) |
Use CuraApplication instead of Application
Because UM.Application has no function getMultiBuildPlateModel.
Contributes to issue CURA-5330.
Diffstat (limited to 'plugins/SupportEraser')
-rw-r--r-- | plugins/SupportEraser/SupportEraser.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/SupportEraser/SupportEraser.py b/plugins/SupportEraser/SupportEraser.py index 06d9fc3707..92b42f9abc 100644 --- a/plugins/SupportEraser/SupportEraser.py +++ b/plugins/SupportEraser/SupportEraser.py @@ -1,22 +1,17 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -import os -import os.path - from PyQt5.QtCore import Qt, QTimer from PyQt5.QtWidgets import QApplication from UM.Math.Vector import Vector from UM.Tool import Tool -from UM.Application import Application from UM.Event import Event, MouseEvent - from UM.Mesh.MeshBuilder import MeshBuilder from UM.Scene.Selection import Selection -from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator -from cura.Scene.CuraSceneNode import CuraSceneNode +from cura.CuraApplication import CuraApplication +from cura.Scene.CuraSceneNode import CuraSceneNode from cura.PickingPass import PickingPass from UM.Operations.GroupedOperation import GroupedOperation @@ -26,8 +21,6 @@ from cura.Operations.SetParentOperation import SetParentOperation from cura.Scene.SliceableObjectDecorator import SliceableObjectDecorator from cura.Scene.BuildPlateDecorator import BuildPlateDecorator -from UM.Scene.GroupDecorator import GroupDecorator -from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator from UM.Settings.SettingInstance import SettingInstance @@ -38,7 +31,7 @@ class SupportEraser(Tool): self._controller = self.getController() self._selection_pass = None - Application.getInstance().globalContainerStackChanged.connect(self._updateEnabled) + CuraApplication.getInstance().globalContainerStackChanged.connect(self._updateEnabled) # Note: if the selection is cleared with this tool active, there is no way to switch to # another tool than to reselect an object (by clicking it) because the tool buttons in the @@ -106,7 +99,7 @@ class SupportEraser(Tool): mesh.addCube(10,10,10) node.setMeshData(mesh.build()) - active_build_plate = Application.getInstance().getMultiBuildPlateModel().activeBuildPlate + active_build_plate = CuraApplication.getInstance().getMultiBuildPlateModel().activeBuildPlate node.addDecorator(BuildPlateDecorator(active_build_plate)) node.addDecorator(SliceableObjectDecorator()) @@ -126,7 +119,7 @@ class SupportEraser(Tool): op.push() node.setPosition(position, CuraSceneNode.TransformSpace.World) - Application.getInstance().getController().getScene().sceneChanged.emit(node) + CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node) def _removeEraserMesh(self, node: CuraSceneNode): parent = node.getParent() @@ -139,16 +132,16 @@ class SupportEraser(Tool): if parent and not Selection.isSelected(parent): Selection.add(parent) - Application.getInstance().getController().getScene().sceneChanged.emit(node) + CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node) def _updateEnabled(self): plugin_enabled = False - global_container_stack = Application.getInstance().getGlobalContainerStack() + global_container_stack = CuraApplication.getInstance().getGlobalContainerStack() if global_container_stack: plugin_enabled = global_container_stack.getProperty("anti_overhang_mesh", "enabled") - Application.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, plugin_enabled) + CuraApplication.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, plugin_enabled) def _onSelectionChanged(self): # When selection is passed from one object to another object, first the selection is cleared |