mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
ENH: add layer num in filament end GCode
jira: NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I6f81b86a7b7391048d70f2c4839733a69015e53b (cherry picked from commit aafcfd72f40dd221286b757da9d494498d36374c)
This commit is contained in:
@@ -698,7 +698,9 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
||||
unsigned int old_filament_id = gcodegen.writer().filament()->id();
|
||||
const std::string& filament_end_gcode = gcodegen.config().filament_end_gcode.get_at(old_filament_id);
|
||||
if (gcodegen.writer().filament() != nullptr && !filament_end_gcode.empty()) {
|
||||
end_filament_gcode_str = gcodegen.placeholder_parser_process("filament_end_gcode", filament_end_gcode, old_filament_id);
|
||||
DynamicConfig config;
|
||||
config.set_key_value("layer_num", new ConfigOptionInt(gcodegen.m_layer_index));
|
||||
end_filament_gcode_str = gcodegen.placeholder_parser_process("filament_end_gcode", filament_end_gcode, old_filament_id, &config);
|
||||
check_add_eol(end_filament_gcode_str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user