Orca filament profile revamp - done (#8287)

* Update Qidi profiles

* restructure orca filament lib folder

* update profiles

* add more global filaments

* check missing instantiation errors

* fix missing instantiation attribute

* delete voron generic filaments

* remove Mellow filaments

* clean profiles

* QoL: select only visible filament when select all filaments
This commit is contained in:
SoftFever 2025-02-03 21:15:17 +08:00 committed by GitHub
parent 0c190860e2
commit dc83549aa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
599 changed files with 9889 additions and 23636 deletions

View file

@ -1209,7 +1209,7 @@ std::pair<PresetsConfigSubstitutions, std::string> PresetBundle::load_system_pre
for (auto &vendor_name : vendor_names)
{
if (validation_mode && !vendor_to_validate.empty() && vendor_name != vendor_to_validate)
if (validation_mode && !vendor_to_validate.empty() && vendor_name != vendor_to_validate && vendor_name != ORCA_FILAMENT_LIBRARY)
continue;
try {
@ -2852,7 +2852,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
std::map<std::string, DynamicPrintConfig>& config_maps,
std::map<std::string, std::string>& filament_id_maps,
PresetCollection* presets_collection,
size_t& count) -> std::string {
size_t& count, bool is_from_lib = false) -> std::string {
std::string subfile = path + "/" + vendor_name + "/" + subfile_iter.second;
// Load the print, filament or printer preset.
@ -2877,7 +2877,16 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
}
preset_name = key_values[BBL_JSON_KEY_NAME];
description = key_values[BBL_JSON_KEY_DESCRIPTION];
if(key_values.find(BBL_JSON_KEY_INSTANTIATION) == key_values.end())
{
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": Missing instantiation attribute for " << preset_name;
++m_errors;
}
instantiation = key_values[BBL_JSON_KEY_INSTANTIATION];
if(instantiation != "false" && instantiation != "true"){
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": Missing instantiation attribute for " << preset_name;
++m_errors;
}
auto setting_it = key_values.find(BBL_JSON_KEY_SETTING_ID);
if (setting_it != key_values.end())
setting_id = setting_it->second;
@ -3019,6 +3028,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
loaded.description = description;
loaded.setting_id = setting_id;
loaded.filament_id = filament_id;
loaded.m_from_orca_filament_lib = is_from_lib;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << loaded.name << " load filament_id: " << filament_id;
if (presets_collection->type() == Preset::TYPE_FILAMENT) {
if (filament_id.empty() && "Template" != vendor_name) {
@ -3085,9 +3095,11 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
presets = &this->filaments;
configs.clear();
filament_id_maps.clear();
const auto is_orca_lib = vendor_name == ORCA_FILAMENT_LIBRARY;
for (auto& subfile : filament_subfiles)
{
std::string reason = parse_subfile(substitution_context, substitutions, flags, subfile, configs, filament_id_maps, presets, presets_loaded);
std::string reason = parse_subfile(substitution_context, substitutions, flags, subfile, configs, filament_id_maps, presets,
presets_loaded, is_orca_lib);
if (!reason.empty()) {
++m_errors;
//parse error
@ -3096,7 +3108,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
throw ConfigurationError((boost::format("Failed loading configuration file %1%\nSuggest cleaning the directory %2% firstly") % subfile_path % path).str());
}
}
if (vendor_name == ORCA_FILAMENT_LIBRARY) {
if (is_orca_lib) {
m_config_maps = configs;
m_filament_id_maps = filament_id_maps;
}