mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Don't send duplicated materials to printer
CURA-4199
This commit is contained in:
parent
8830fa7e10
commit
053fdd679d
1 changed files with 8 additions and 0 deletions
|
@ -12,6 +12,7 @@ import UM.Settings.ContainerRegistry
|
|||
import UM.Version #To compare firmware version numbers.
|
||||
|
||||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState
|
||||
from cura.Settings.ContainerManager import ContainerManager
|
||||
import cura.Settings.ExtruderManager
|
||||
|
||||
from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager, QNetworkReply
|
||||
|
@ -915,6 +916,13 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
xml_data = container.serialize()
|
||||
if xml_data == "" or xml_data is None:
|
||||
continue
|
||||
|
||||
names = ContainerManager.getInstance().getLinkedMaterials(container.getId())
|
||||
if names:
|
||||
# There are other materials that share this GUID.
|
||||
if not container.isReadOnly():
|
||||
continue # If it's not readonly, it's created by user, so skip it.
|
||||
|
||||
material_multi_part = QHttpMultiPart(QHttpMultiPart.FormDataType)
|
||||
|
||||
material_part = QHttpPart()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue