From db8a625d8fdece858d3766b9c24c5685d4ef7e97 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Thu, 5 Jun 2025 20:57:24 +0200 Subject: [PATCH] Update PurgeLinesAndUnload.py Fixes an exception thrown upon a clean start. --- .../PostProcessingPlugin/scripts/PurgeLinesAndUnload.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py index ca95359e29..922aad902f 100644 --- a/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py +++ b/plugins/PostProcessingPlugin/scripts/PurgeLinesAndUnload.py @@ -37,6 +37,10 @@ class PurgeLinesAndUnload(Script): def __init__(self): super().__init__() + + def initialize(self) -> None: + super().initialize() + # Get required values from the global stack and set default values for the script self.global_stack = Application.getInstance().getGlobalContainerStack() self.extruder = self.global_stack.extruderList self.end_purge_location = None @@ -56,9 +60,6 @@ class PurgeLinesAndUnload(Script): self.machine_back = self.machine_depth - 1.0 self.start_x = None self.start_y = None - - def initialize(self) -> None: - super().initialize() # Get the StartUp Gcode from Cura and attempt to catch if it contains purge lines. Message the user if an extrusion is in the startup. startup_gcode = self.global_stack.getProperty("machine_start_gcode", "value") start_lines = startup_gcode.splitlines()