mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Don't make retract distances negative
People are reporting that the retraction is reversed. We can't test it since we have no firmware that supports the command at all. So we'll just not make the retract distance negative. That seems more logical anyway if you read the documentation of M600 to the letter. Fixes #4249.
This commit is contained in:
parent
0e1e8d269a
commit
c7b146c9fc
1 changed files with 10 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
||||||
# This PostProcessing Plugin script is released
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# under the terms of the AGPLv3 or higher
|
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
@ -54,17 +55,17 @@ class FilamentChange(Script):
|
||||||
layer_nums = self.getSettingValueByKey("layer_number")
|
layer_nums = self.getSettingValueByKey("layer_number")
|
||||||
initial_retract = self.getSettingValueByKey("initial_retract")
|
initial_retract = self.getSettingValueByKey("initial_retract")
|
||||||
later_retract = self.getSettingValueByKey("later_retract")
|
later_retract = self.getSettingValueByKey("later_retract")
|
||||||
|
|
||||||
color_change = "M600"
|
color_change = "M600"
|
||||||
|
|
||||||
if initial_retract is not None and initial_retract > 0.:
|
if initial_retract is not None and initial_retract > 0.:
|
||||||
color_change = color_change + (" E-%.2f" % initial_retract)
|
color_change = color_change + (" E%.2f" % initial_retract)
|
||||||
|
|
||||||
if later_retract is not None and later_retract > 0.:
|
if later_retract is not None and later_retract > 0.:
|
||||||
color_change = color_change + (" L-%.2f" % later_retract)
|
color_change = color_change + (" L%.2f" % later_retract)
|
||||||
|
|
||||||
color_change = color_change + " ; Generated by FilamentChange plugin"
|
color_change = color_change + " ; Generated by FilamentChange plugin"
|
||||||
|
|
||||||
layer_targets = layer_nums.split(",")
|
layer_targets = layer_nums.split(",")
|
||||||
if len(layer_targets) > 0:
|
if len(layer_targets) > 0:
|
||||||
for layer_num in layer_targets:
|
for layer_num in layer_targets:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue