mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-16 08:12:39 -07:00
Fixed preset updating
This commit is contained in:
@@ -168,12 +168,14 @@ void PresetBundle::setup_directories()
|
||||
data_dir / "presets",
|
||||
data_dir / "presets" / "print",
|
||||
data_dir / "presets" / "filament",
|
||||
data_dir / "presets" / "sla_print",
|
||||
data_dir / "presets" / "sla_material",
|
||||
data_dir / "presets" / "printer"
|
||||
#else
|
||||
// Store the print/filament/printer presets at the same location as the upstream Slic3r.
|
||||
data_dir / "print",
|
||||
data_dir / "filament",
|
||||
data_dir / "sla_print",
|
||||
data_dir / "sla_material",
|
||||
data_dir / "printer"
|
||||
#endif
|
||||
@@ -381,13 +383,13 @@ void PresetBundle::export_selections(AppConfig &config)
|
||||
assert(this->printers.get_edited_preset().printer_technology() != ptFFF || filament_presets.size() > 1 || filaments.get_selected_preset_name() == filament_presets.front());
|
||||
config.clear_section("presets");
|
||||
config.set("presets", "print", prints.get_selected_preset_name());
|
||||
config.set("presets", "sla_print", sla_prints.get_selected_preset_name());
|
||||
config.set("presets", "filament", filament_presets.front());
|
||||
for (int i = 1; i < filament_presets.size(); ++i) {
|
||||
char name[64];
|
||||
sprintf(name, "filament_%d", i);
|
||||
config.set("presets", name, filament_presets[i]);
|
||||
}
|
||||
config.set("presets", "sla_print", sla_prints.get_selected_preset_name());
|
||||
config.set("presets", "sla_material", sla_materials.get_selected_preset_name());
|
||||
config.set("presets", "printer", printers.get_selected_preset_name());
|
||||
}
|
||||
@@ -955,8 +957,8 @@ static void flatten_configbundle_hierarchy(boost::property_tree::ptree &tree, co
|
||||
static void flatten_configbundle_hierarchy(boost::property_tree::ptree &tree)
|
||||
{
|
||||
flatten_configbundle_hierarchy(tree, "print");
|
||||
flatten_configbundle_hierarchy(tree, "sla_print");
|
||||
flatten_configbundle_hierarchy(tree, "filament");
|
||||
flatten_configbundle_hierarchy(tree, "sla_print");
|
||||
flatten_configbundle_hierarchy(tree, "sla_material");
|
||||
flatten_configbundle_hierarchy(tree, "printer");
|
||||
}
|
||||
@@ -1018,7 +1020,7 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla
|
||||
} else if (boost::starts_with(section.first, "sla_print:")) {
|
||||
presets = &this->sla_prints;
|
||||
loaded = &loaded_sla_prints;
|
||||
preset_name = section.first.substr(13);
|
||||
preset_name = section.first.substr(10);
|
||||
} else if (boost::starts_with(section.first, "sla_material:")) {
|
||||
presets = &this->sla_materials;
|
||||
loaded = &loaded_sla_materials;
|
||||
|
||||
Reference in New Issue
Block a user