mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix extruder stack corruption
CURA-12346 For some dark reason, importing the ExtruderStack class in the ThreeMFWriter somehow corrupts the loading of the extruders stacks. As it is imported only for typing, do the import only for type-checking.
This commit is contained in:
parent
38e1140454
commit
a6e324b748
1 changed files with 5 additions and 3 deletions
|
@ -8,10 +8,12 @@ import json
|
|||
import re
|
||||
import threading
|
||||
|
||||
from typing import Optional, cast, List, Dict, Pattern, Set
|
||||
from typing import Optional, cast, List, Dict, Set, TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from Settings.ExtruderStack import ExtruderStack
|
||||
|
||||
from Machines.Models.ExtrudersModel import ExtrudersModel
|
||||
from Settings.ExtruderStack import ExtruderStack
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Mesh.MeshWriter import MeshWriter
|
||||
from UM.Math.Vector import Vector
|
||||
|
@ -461,7 +463,7 @@ class ThreeMFWriter(MeshWriter):
|
|||
return ET.Element("Relationships", xmlns=self._namespaces["relationships"])
|
||||
|
||||
@staticmethod
|
||||
def _getMaterialColor(extruder: ExtruderStack) -> str:
|
||||
def _getMaterialColor(extruder: "ExtruderStack") -> str:
|
||||
position = int(extruder.getMetaDataEntry("position", default="0"))
|
||||
try:
|
||||
default_color = ExtrudersModel.defaultColors[position]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue