Don't consider ' ' or '\n' for custom toolchange gcode detection

supermerill/SuperSlicer#1368
This commit is contained in:
supermerill 2021-12-11 21:41:40 +01:00
parent 5a5ea52a6e
commit b1e044855e

View File

@ -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;