mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 11:47:54 -06:00
Moved "wiping_volumes_extruders", "wiping_volumes_matrix" from
print settings to project settings.
This commit is contained in:
parent
d54425a901
commit
be8acc5ac4
5 changed files with 34 additions and 79 deletions
|
@ -32,7 +32,9 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
static std::vector<std::string> s_project_options {
|
||||
static std::vector<std::string> s_project_options {
|
||||
"wiping_volumes_extruders",
|
||||
"wiping_volumes_matrix"
|
||||
};
|
||||
|
||||
PresetBundle::PresetBundle() :
|
||||
|
@ -722,11 +724,11 @@ void PresetBundle::update_multi_material_filament_presets()
|
|||
|
||||
|
||||
// Now verify if wiping_volumes_matrix has proper size (it is used to deduce number of extruders in wipe tower generator):
|
||||
std::vector<double> old_matrix = (prints.get_edited_preset().config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values;
|
||||
std::vector<double> old_matrix = this->project_config.option<ConfigOptionFloats>("wiping_volumes_matrix")->values;
|
||||
size_t old_number_of_extruders = int(sqrt(old_matrix.size())+EPSILON);
|
||||
if (num_extruders != old_number_of_extruders) {
|
||||
// First verify if purging volumes presets for each extruder matches number of extruders
|
||||
std::vector<double>& extruders = (prints.get_edited_preset().config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values;
|
||||
std::vector<double>& extruders = this->project_config.option<ConfigOptionFloats>("wiping_volumes_extruders")->values;
|
||||
while (extruders.size() < 2*num_extruders) {
|
||||
extruders.push_back(extruders.size()>1 ? extruders[0] : 50.); // copy the values from the first extruder
|
||||
extruders.push_back(extruders.size()>1 ? extruders[1] : 50.);
|
||||
|
@ -745,7 +747,7 @@ void PresetBundle::update_multi_material_filament_presets()
|
|||
else
|
||||
new_matrix.push_back( i==j ? 0. : extruders[2*i]+extruders[2*j+1]); // so it matches new extruder volumes
|
||||
}
|
||||
(prints.get_edited_preset().config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values = new_matrix;
|
||||
this->project_config.option<ConfigOptionFloats>("wiping_volumes_matrix")->values = new_matrix;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue