mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-17 07:01:54 -06:00
suport renamed_from
This commit is contained in:
parent
26a55a1267
commit
7179797d55
4 changed files with 19 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue