CURA-4400 fix disallowed areas by fixing the limit_to_extruder -1 value

This commit is contained in:
Jack Ha 2018-03-19 11:46:43 +01:00
parent d676b85289
commit 906ebe12e1
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,7 @@ from typing import Any, TYPE_CHECKING, Optional
from PyQt5.QtCore import pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Decorators import override
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
from UM.Settings.ContainerStack import ContainerStack
@ -111,6 +112,8 @@ class ExtruderStack(CuraContainerStack):
limit_to_extruder = super().getProperty(key, "limit_to_extruder", context)
if limit_to_extruder is not None:
if limit_to_extruder == -1:
limit_to_extruder = int(Application.getInstance().getMachineManager().defaultExtruderPosition)
limit_to_extruder = str(limit_to_extruder)
if (limit_to_extruder is not None and limit_to_extruder != "-1") and self.getMetaDataEntry("position") != str(limit_to_extruder):
if str(limit_to_extruder) in self.getNextStack().extruders: