From c7b146c9fc3bc287b456e9eea5b17aad4b689086 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 25 Oct 2018 13:53:01 +0200 Subject: [PATCH] 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. --- .../scripts/FilamentChange.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/FilamentChange.py b/plugins/PostProcessingPlugin/scripts/FilamentChange.py index 0fa52de4f1..ed0f6eb174 100644 --- a/plugins/PostProcessingPlugin/scripts/FilamentChange.py +++ b/plugins/PostProcessingPlugin/scripts/FilamentChange.py @@ -1,5 +1,6 @@ -# This PostProcessing Plugin script is released -# under the terms of the AGPLv3 or higher +# Copyright (c) 2018 Ultimaker B.V. +# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher. + from typing import Optional, Tuple from UM.Logger import Logger @@ -54,17 +55,17 @@ class FilamentChange(Script): layer_nums = self.getSettingValueByKey("layer_number") initial_retract = self.getSettingValueByKey("initial_retract") later_retract = self.getSettingValueByKey("later_retract") - + color_change = "M600" - + 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.: - color_change = color_change + (" L-%.2f" % later_retract) - + color_change = color_change + (" L%.2f" % later_retract) + color_change = color_change + " ; Generated by FilamentChange plugin" - + layer_targets = layer_nums.split(",") if len(layer_targets) > 0: for layer_num in layer_targets: