mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:56:01 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
615cfae465
@ -3,10 +3,12 @@
|
|||||||
|
|
||||||
from UM.Tool import Tool
|
from UM.Tool import Tool
|
||||||
from UM.Scene.Selection import Selection
|
from UM.Scene.Selection import Selection
|
||||||
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||||
|
|
||||||
|
|
||||||
## This tool allows the user to add & change settings per node in the scene.
|
## This tool allows the user to add & change settings per node in the scene.
|
||||||
# The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
|
# The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
|
||||||
class PerObjectSettingsTool(Tool):
|
class PerObjectSettingsTool(Tool):
|
||||||
@ -69,6 +71,11 @@ class PerObjectSettingsTool(Tool):
|
|||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||||
|
if not self._multi_extrusion:
|
||||||
|
# Ensure that all extruder data is reset
|
||||||
|
root_node = Application.getInstance().getController().getScene().getRoot()
|
||||||
|
for node in DepthFirstIterator(root_node):
|
||||||
|
node.callDecoration("setActiveExtruder", global_container_stack.getId())
|
||||||
self._updateEnabled()
|
self._updateEnabled()
|
||||||
|
|
||||||
def _updateEnabled(self):
|
def _updateEnabled(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user