diff options
author | fieldOfView <aldo@fieldofview.com> | 2018-03-11 15:06:30 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2018-03-14 12:08:00 +0300 |
commit | 7e4cb1c36ecb4aed44bc9da4aab676eed21e1ae3 (patch) | |
tree | 7e5bca27740cb69ff6b94f5df9ada3b704322363 /plugins/SupportEraser | |
parent | a536da503bf374f5db0fec5180e9989294f77c22 (diff) |
Disable Support Eraser if anti_overhang_mesh is disabled
Diffstat (limited to 'plugins/SupportEraser')
-rw-r--r-- | plugins/SupportEraser/SupportEraser.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/SupportEraser/SupportEraser.py b/plugins/SupportEraser/SupportEraser.py index 35713805bc..65d22bcdfd 100644 --- a/plugins/SupportEraser/SupportEraser.py +++ b/plugins/SupportEraser/SupportEraser.py @@ -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) |