mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Remove defaults section from current settings before adding it to a gcode file.
Contributes to CURA-936
This commit is contained in:
parent
05a9b449af
commit
90fda4cb3d
@ -6,6 +6,7 @@ from UM.Logger import Logger
|
|||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
import io
|
import io
|
||||||
import re #For escaping characters in the settings.
|
import re #For escaping characters in the settings.
|
||||||
|
import copy
|
||||||
|
|
||||||
|
|
||||||
class GCodeWriter(MeshWriter):
|
class GCodeWriter(MeshWriter):
|
||||||
@ -57,7 +58,8 @@ class GCodeWriter(MeshWriter):
|
|||||||
prefix = ";SETTING_" + str(GCodeWriter.version) + " " #The prefix to put before each line.
|
prefix = ";SETTING_" + str(GCodeWriter.version) + " " #The prefix to put before each line.
|
||||||
prefix_length = len(prefix)
|
prefix_length = len(prefix)
|
||||||
|
|
||||||
serialised = profile.serialise()
|
#Serialise a deepcopy to remove the defaults from the profile
|
||||||
|
serialised = copy.deepcopy(profile).serialise()
|
||||||
|
|
||||||
#Escape characters that have a special meaning in g-code comments.
|
#Escape characters that have a special meaning in g-code comments.
|
||||||
pattern = re.compile("|".join(GCodeWriter.escape_characters.keys()))
|
pattern = re.compile("|".join(GCodeWriter.escape_characters.keys()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user