mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 21:27:50 -06:00
Revert "CURA-5456 Fix some code-style"
CURA-5456
This reverts commit c5d48a3a9a
.
This commit is contained in:
parent
1b3706e172
commit
abed6052d0
1 changed files with 3 additions and 12 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
import copy
|
||||
import uuid
|
||||
from typing import cast
|
||||
|
||||
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
||||
from UM.Signal import Signal, signalemitter
|
||||
|
@ -13,7 +12,6 @@ from UM.Logger import Logger
|
|||
from UM.Util import parseBool
|
||||
|
||||
from UM.Application import Application
|
||||
from cura.Settings.CuraContainerStack import CuraContainerStack
|
||||
|
||||
from cura.Settings.PerObjectContainerStack import PerObjectContainerStack
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
@ -64,8 +62,6 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
if not parseBool(self._extruder_stack.getMetaDataEntry("enabled", "True")):
|
||||
# switch to the first extruder that's available
|
||||
global_stack = Application.getInstance().getMachineManager().activeMachine
|
||||
if global_stack is None:
|
||||
return
|
||||
for _, extruder in sorted(list(global_stack.extruders.items())):
|
||||
if parseBool(extruder.getMetaDataEntry("enabled", "True")):
|
||||
self._extruder_stack = extruder
|
||||
|
@ -86,9 +82,6 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
deep_copy._stack.replaceContainer(0, instance_container)
|
||||
|
||||
# Properly set the right extruder on the copy
|
||||
if self._extruder_stack is None:
|
||||
deep_copy._extruder_stack = None
|
||||
else:
|
||||
deep_copy.setActiveExtruder(self._extruder_stack.getId())
|
||||
|
||||
# use value from the stack because there can be a delay in signal triggering and "_is_non_printing_mesh"
|
||||
|
@ -155,14 +148,12 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||
Application.getInstance().getBackend().needsSlicing()
|
||||
Application.getInstance().getBackend().tickle()
|
||||
else:
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_stack:
|
||||
self._stack.setNextStack(cast(CuraContainerStack, global_stack))
|
||||
self._stack.setNextStack(Application.getInstance().getGlobalContainerStack())
|
||||
|
||||
## Changes the extruder with which to print this node.
|
||||
#
|
||||
# \param extruder_stack_id The new extruder stack to print with.
|
||||
def setActiveExtruder(self, extruder_stack_id: str) -> None:
|
||||
def setActiveExtruder(self, extruder_stack_id):
|
||||
if self._extruder_stack is None or self._extruder_stack.getId() == extruder_stack_id:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue