mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Also rebuild when mesh extruder changes
I do not want to add the rebuild() call to the update function itself since there may be other changes to the build volume before we should rebuild (such as raft). Contributes to issue CURA-2625.
This commit is contained in:
parent
2492b03c4f
commit
35a01435d5
1 changed files with 14 additions and 3 deletions
|
@ -112,7 +112,7 @@ class BuildVolume(SceneNode):
|
|||
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.callDecoration("getActiveExtruderChangedSignal").disconnect(self._updateDisallowedAreasAndRebuild)
|
||||
node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged)
|
||||
|
||||
self._scene_objects = new_scene_objects
|
||||
|
@ -127,8 +127,8 @@ class BuildVolume(SceneNode):
|
|||
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()
|
||||
active_extruder_changed.connect(self._updateDisallowedAreasAndRebuild)
|
||||
self._updateDisallowedAreasAndRebuild()
|
||||
|
||||
def setWidth(self, width):
|
||||
if width: self._width = width
|
||||
|
@ -391,6 +391,17 @@ class BuildVolume(SceneNode):
|
|||
def hasErrors(self):
|
||||
return self._has_errors
|
||||
|
||||
## Calls _updateDisallowedAreas and makes sure the changes appear in the
|
||||
# scene.
|
||||
#
|
||||
# This is required for a signal to trigger the update in one go. The
|
||||
# ``_updateDisallowedAreas`` method itself shouldn't call ``rebuild``,
|
||||
# since there may be other changes before it needs to be rebuilt, which
|
||||
# would hit performance.
|
||||
def _updateDisallowedAreasAndRebuild(self):
|
||||
self._updateDisallowedAreas()
|
||||
self.rebuild()
|
||||
|
||||
def _updateDisallowedAreas(self):
|
||||
if not self._global_container_stack:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue