num_extruders is now available from the output_file_name template.

This commit is contained in:
bubnikv 2020-03-11 18:12:44 +01:00
parent cd381d6b4f
commit 88fcdf4b97

View file

@ -2138,6 +2138,7 @@ std::string Print::output_filename(const std::string &filename_base) const
// Set the placeholders for the data know first after the G-code export is finished.
// These values will be just propagated into the output file name.
DynamicConfig config = this->finished() ? this->print_statistics().config() : this->print_statistics().placeholders();
config.set_key_value("num_extruders", new ConfigOptionInt((int)m_config.nozzle_diameter.size()));
return this->PrintBase::output_filename(m_config.output_filename_format.value, ".gcode", filename_base, &config);
}