Disable Support Eraser if anti_overhang_mesh is disabled

This commit is contained in:
fieldOfView 2018-03-11 13:06:30 +01:00
parent a536da503b
commit 7e4cb1c36e

View file

@ -24,6 +24,8 @@ class SupportEraser(Tool):
self._shortcut_key = Qt.Key_G
self._controller = Application.getInstance().getController()
Application.getInstance().globalContainerStackChanged.connect(self._updateEnabled)
def event(self, event):
super().event(event)
@ -73,3 +75,12 @@ class SupportEraser(Tool):
op = AddSceneNodeOperation(node, scene.getRoot())
op.push()
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)