From b1e044855e1f38a5b177ce9b58d3d09cef89c3f1 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 11 Dec 2021 21:41:40 +0100 Subject: Don't consider ' ' or '\n' for custom toolchange gcode detection supermerill/SuperSlicer#1368 --- src/libslic3r/GCode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index b4f546bf7..cd4a79af0 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4401,7 +4401,8 @@ std::string GCode::toolchange(uint16_t extruder_id, double print_z) { std::string gcode; // Process the custom toolchange_gcode. If it is empty, insert just a Tn command. - const std::string& toolchange_gcode = m_config.toolchange_gcode.value; + std::string toolchange_gcode = m_config.toolchange_gcode.value; + boost::trim(toolchange_gcode); //remove invisible characters that may compromize the 'toolchange_gcode.empty()' std::string toolchange_gcode_parsed; if (!toolchange_gcode.empty() && m_writer.multiple_extruders) { DynamicConfig config; -- cgit v1.2.3