mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix the insert & timelapse script so that you can use both at the same time
CURA-5713
This commit is contained in:
parent
4756e8b7bc
commit
72eb90c7c1
2 changed files with 15 additions and 13 deletions
|
@ -37,13 +37,14 @@ class InsertAtLayerChange(Script):
|
||||||
for layer in data:
|
for layer in data:
|
||||||
# Check that a layer is being printed
|
# Check that a layer is being printed
|
||||||
lines = layer.split("\n")
|
lines = layer.split("\n")
|
||||||
if ";LAYER:" in lines[0]:
|
for line in lines:
|
||||||
index = data.index(layer)
|
if ";LAYER:" in line:
|
||||||
if self.getSettingValueByKey("insert_location") == "before":
|
index = data.index(layer)
|
||||||
layer = gcode_to_add + layer
|
if self.getSettingValueByKey("insert_location") == "before":
|
||||||
else:
|
layer = gcode_to_add + layer
|
||||||
layer = layer + gcode_to_add
|
else:
|
||||||
|
layer = layer + gcode_to_add
|
||||||
data[index] = layer
|
|
||||||
|
|
||||||
|
data[index] = layer
|
||||||
|
break
|
||||||
return data
|
return data
|
||||||
|
|
|
@ -85,10 +85,11 @@ class TimeLapse(Script):
|
||||||
for layer in data:
|
for layer in data:
|
||||||
# Check that a layer is being printed
|
# Check that a layer is being printed
|
||||||
lines = layer.split("\n")
|
lines = layer.split("\n")
|
||||||
if ";LAYER:" in lines[0]:
|
for line in lines:
|
||||||
index = data.index(layer)
|
if ";LAYER:" in line:
|
||||||
layer += gcode_to_append
|
index = data.index(layer)
|
||||||
|
layer += gcode_to_append
|
||||||
data[index] = layer
|
|
||||||
|
|
||||||
|
data[index] = layer
|
||||||
|
break
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue