Update disallowed area when object's extruder is changed

This calls _updateDisallowedAreas() but not rebuild(), so the change is not visible at this moment.

Contributes to issue CURA-2625.
This commit is contained in:
Ghostkeeper 2016-11-15 13:05:15 +01:00
parent 60c8933906
commit 2492b03c4f
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 13 additions and 0 deletions

View file

@ -110,6 +110,9 @@ class BuildVolume(SceneNode):
per_mesh_stack = node.callDecoration("getStack") per_mesh_stack = node.callDecoration("getStack")
if per_mesh_stack: if per_mesh_stack:
per_mesh_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) per_mesh_stack.propertyChanged.disconnect(self._onSettingPropertyChanged)
active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal")
if active_extruder_changed is not None:
node.callDecoration("getActiveExtruderChangedSignal").disconnect(self._updateDisallowedAreas)
node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged) node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged)
self._scene_objects = new_scene_objects self._scene_objects = new_scene_objects
@ -122,6 +125,10 @@ class BuildVolume(SceneNode):
per_mesh_stack = node.callDecoration("getStack") per_mesh_stack = node.callDecoration("getStack")
if per_mesh_stack: if per_mesh_stack:
per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged) per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged)
active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal")
if active_extruder_changed is not None:
active_extruder_changed.connect(self._updateDisallowedAreas)
self._updateDisallowedAreas()
def setWidth(self, width): def setWidth(self, width):
if width: self._width = width if width: self._width = width

View file

@ -61,6 +61,12 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def getActiveExtruder(self): def getActiveExtruder(self):
return self._extruder_stack return self._extruder_stack
## Gets the signal that emits if the active extruder changed.
#
# This can then be accessed via a decorator.
def getActiveExtruderChangedSignal(self):
return self.activeExtruderChanged
## Gets the currently active extruders position ## Gets the currently active extruders position
# #
# \return An extruder's position, or None if no position info is available. # \return An extruder's position, or None if no position info is available.