Add printing_filament_types placeholder for the output filename (#14706)

Adds the printing_filament_types placeholder. It lists the filament types that are actually printed on the plate, with duplicates removed, in filament order, joined with "_" (for example ABS_PLA). It works in the file name template and in custom G-code. Before slicing, the file name shows the placeholder unfilled, the same way print_time does.

Nothing changes for templates that don't use it.
This commit is contained in:
foXaCe authored and GitHub committed 2026-10-29 15:53:19 -05:00
1 parent 5ea64864ef
commit f273fe8ac1
5 files changed
+60 -4

No files matched your search

+3 -1
View File
@@ -5873,6 +5873,7 @@ DynamicConfig PrintStatistics::config() const
config.set_key_value("initial_tool", new ConfigOptionInt(static_cast<int>(this->initial_tool)));
config.set_key_value("initial_extruder", new ConfigOptionInt(static_cast<int>(this->initial_tool)));
config.set_key_value("initial_no_support_extruder", new ConfigOptionInt(static_cast<int>(this->initial_no_support_tool)));
config.set_key_value("printing_filament_types", new ConfigOptionString(this->printing_filament_types));
return config;
}
@@ -5882,7 +5883,8 @@ DynamicConfig PrintStatistics::placeholders()
for (const std::string key : {
"print_time", "normal_print_time", "silent_print_time",
"used_filament", "extruded_volume", "extruded_volume_total", "total_cost", "total_weight", "extruded_weight_total",
"initial_tool", "initial_extruder", "initial_no_support_extruder", "total_toolchanges", "total_wipe_tower_cost", "total_wipe_tower_filament"})
"initial_tool", "initial_extruder", "initial_no_support_extruder", "total_toolchanges", "total_wipe_tower_cost", "total_wipe_tower_filament",
"printing_filament_types"})
config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}"));
return config;
}