mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
197508028a
@ -184,6 +184,9 @@ class PauseAtHeight(Script):
|
|||||||
prevLayer = data[index - 1]
|
prevLayer = data[index - 1]
|
||||||
prevLines = prevLayer.split("\n")
|
prevLines = prevLayer.split("\n")
|
||||||
current_e = 0.
|
current_e = 0.
|
||||||
|
|
||||||
|
# Access last layer, browse it backwards to find
|
||||||
|
# last extruder absolute position
|
||||||
for prevLine in reversed(prevLines):
|
for prevLine in reversed(prevLines):
|
||||||
current_e = self.getValue(prevLine, "E", -1)
|
current_e = self.getValue(prevLine, "E", -1)
|
||||||
if current_e >= 0:
|
if current_e >= 0:
|
||||||
@ -194,6 +197,18 @@ class PauseAtHeight(Script):
|
|||||||
prevLayer = data[index - i]
|
prevLayer = data[index - i]
|
||||||
layer = prevLayer + layer
|
layer = prevLayer + layer
|
||||||
|
|
||||||
|
# Get extruder's absolute position at the
|
||||||
|
# begining of the first layer redone
|
||||||
|
# see https://github.com/nallath/PostProcessingPlugin/issues/55
|
||||||
|
if i == redo_layers:
|
||||||
|
prevLines = prevLayer.split("\n")
|
||||||
|
for line in prevLines:
|
||||||
|
new_e = self.getValue(line, 'E', current_e)
|
||||||
|
|
||||||
|
if new_e != current_e:
|
||||||
|
current_e = new_e
|
||||||
|
break
|
||||||
|
|
||||||
prepend_gcode = ";TYPE:CUSTOM\n"
|
prepend_gcode = ";TYPE:CUSTOM\n"
|
||||||
prepend_gcode += ";added code by post processing\n"
|
prepend_gcode += ";added code by post processing\n"
|
||||||
prepend_gcode += ";script: PauseAtHeight.py\n"
|
prepend_gcode += ";script: PauseAtHeight.py\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user