mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
CURA-4946 Add the quality_definition metadata entry to the gcode so when
parsing, the quality definition is taken into account instead of the definition. The message when importing a profile to a different machine, now shows the expected machine and the current machine definition id.!!
This commit is contained in:
parent
85059882fe
commit
744313af27
2 changed files with 17 additions and 5 deletions
|
@ -5,6 +5,7 @@ from UM.Mesh.MeshWriter import MeshWriter
|
|||
from UM.Logger import Logger
|
||||
from UM.Application import Application
|
||||
from UM.Settings.InstanceContainer import InstanceContainer
|
||||
from UM.Util import parseBool
|
||||
|
||||
from cura.Settings.ExtruderManager import ExtruderManager
|
||||
|
||||
|
@ -120,6 +121,10 @@ class GCodeWriter(MeshWriter):
|
|||
if flat_global_container.getMetaDataEntry("quality_type", None) is None:
|
||||
flat_global_container.addMetaDataEntry("quality_type", stack.quality.getMetaDataEntry("quality_type", "normal"))
|
||||
|
||||
# Ensure that quality_definition is set. (Can happen if we have empty quality changes).
|
||||
if parseBool(stack.getMetaDataEntry("has_machine_quality", "False")):
|
||||
flat_global_container.addMetaDataEntry("quality_definition", stack.getMetaDataEntry("quality_definition"))
|
||||
|
||||
serialized = flat_global_container.serialize()
|
||||
data = {"global_quality": serialized}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue