mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 02:29:00 +08:00
Disable Support Eraser if anti_overhang_mesh is disabled
This commit is contained in:
parent
a536da503b
commit
7e4cb1c36e
@ -24,6 +24,8 @@ class SupportEraser(Tool):
|
|||||||
self._shortcut_key = Qt.Key_G
|
self._shortcut_key = Qt.Key_G
|
||||||
self._controller = Application.getInstance().getController()
|
self._controller = Application.getInstance().getController()
|
||||||
|
|
||||||
|
Application.getInstance().globalContainerStackChanged.connect(self._updateEnabled)
|
||||||
|
|
||||||
def event(self, event):
|
def event(self, event):
|
||||||
super().event(event)
|
super().event(event)
|
||||||
|
|
||||||
@ -73,3 +75,12 @@ class SupportEraser(Tool):
|
|||||||
op = AddSceneNodeOperation(node, scene.getRoot())
|
op = AddSceneNodeOperation(node, scene.getRoot())
|
||||||
op.push()
|
op.push()
|
||||||
Application.getInstance().getController().getScene().sceneChanged.emit(node)
|
Application.getInstance().getController().getScene().sceneChanged.emit(node)
|
||||||
|
|
||||||
|
def _updateEnabled(self):
|
||||||
|
plugin_enabled = False
|
||||||
|
|
||||||
|
global_container_stack = Application.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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user