diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 192d42bf43..8e7f43d9f8 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3299,7 +3299,12 @@ std::string GCodeGenerator::set_extruder(unsigned int extruder_id, double print_ unsigned int old_extruder_id = m_writer.extruder()->id(); const std::string &end_filament_gcode = m_config.end_filament_gcode.get_at(old_extruder_id); if (! end_filament_gcode.empty()) { - gcode += placeholder_parser_process("end_filament_gcode", end_filament_gcode, old_extruder_id); + DynamicConfig config; + config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position().z() - m_config.z_offset.value)); + config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); + config.set_key_value("filament_extruder_id", new ConfigOptionInt(int(old_extruder_id))); + gcode += placeholder_parser_process("end_filament_gcode", end_filament_gcode, old_extruder_id, &config); check_add_eol(gcode); } } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index e521b2bc08..15b7639227 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5185,7 +5185,7 @@ DimensionsConfigDef::DimensionsConfigDef() def = this->add("first_layer_print_convex_hull", coPoints); def->label = L("First layer convex hull"); - def->tooltip = L("Vector of points of the first layer convex hull. Each element has the following format:" + def->tooltip = L("Vector of points of the first layer convex hull. Each element has the following format: " "'[x, y]' (x and y are floating-point numbers in mm)."); def = this->add("first_layer_print_min", coFloats); @@ -5252,7 +5252,7 @@ OtherPresetsConfigDef::OtherPresetsConfigDef() def->label = L("Print preset name"); def->tooltip = L("Name of the print preset used for slicing."); - def = this->add("filament_preset", coString); + def = this->add("filament_preset", coStrings); def->label = L("Filament preset name"); def->tooltip = L("Names of the filament presets used for slicing. The variable is a vector " "containing one name for each extruder."); @@ -5287,7 +5287,7 @@ CustomGcodeSpecificConfigDef::CustomGcodeSpecificConfigDef() def = this->add("layer_num", coInt); def->label = L("Layer number"); - def->tooltip = L("Index of the current layer. One-based (i.e. first layer is number 1)."); + def->tooltip = L("Zero-based index of the current layer (i.e. first layer is number 0)."); def = this->add("layer_z", coFloat); def->label = L("Layer z"); @@ -5298,8 +5298,8 @@ CustomGcodeSpecificConfigDef::CustomGcodeSpecificConfigDef() def->tooltip = L("Height of the last layer above the print bed."); def = this->add("filament_extruder_id", coInt); - def->label = L(""); - def->tooltip = L(""); + def->label = L("Current extruder index"); + def->tooltip = L("Zero-based index of currently used extruder (i.e. first extruder has index 0)."); def = this->add("previous_extruder", coInt); def->label = L("Previous extruder");