mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-22 10:22:08 +00:00
suport renamed_from
This commit is contained in:
@@ -3533,6 +3533,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
|
||||
|
||||
//parse the json elements
|
||||
DynamicPrintConfig config_src;
|
||||
std::string _renamed_from_str;
|
||||
config_src.load_from_json(subfile, substitution_context, false, key_values, reason);
|
||||
if (!reason.empty()) {
|
||||
++m_errors;
|
||||
@@ -3586,9 +3587,12 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
|
||||
}
|
||||
if (config.has("alias"))
|
||||
alias_name = (dynamic_cast<const ConfigOptionString *>(config.option("alias")))->value;
|
||||
if (config.has("renamed_from")) {
|
||||
const ConfigOptionVectorBase *vec = static_cast<const ConfigOptionVectorBase*>(config.option("renamed_from"));
|
||||
renamed_from = vec->vserialize();
|
||||
|
||||
if (key_values.find(ORCA_JSON_KEY_RENAMED_FROM) != key_values.end()) {
|
||||
if (!unescape_strings_cstyle(key_values[ORCA_JSON_KEY_RENAMED_FROM], renamed_from)) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Error in a Config \"" << path << "\": The preset \"" << preset_name
|
||||
<< "\" contains invalid \"renamed_from\" key, which is being ignored.";
|
||||
}
|
||||
}
|
||||
Preset::normalize(config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user