Updated AMF/3MF import to pass configuration into a DynamicPrintConfig

instead of PresetBundle.
This commit is contained in:
bubnikv 2018-09-25 11:53:05 +02:00
parent 1398d5d09a
commit 9a3db200a5
10 changed files with 81 additions and 134 deletions

View file

@ -133,11 +133,12 @@ int main(int argc, char **argv)
// apply command line options to a more specific DynamicPrintConfig which provides normalize()
// (command line options override --load files)
print_config.apply(config, true);
print_config.normalize();
// write config if requested
if (! cli_config.save.value.empty())
if (! cli_config.save.value.empty()) {
print_config.normalize();
print_config.save(cli_config.save.value);
}
if (cli_config.help) {
printUsage();
@ -153,7 +154,7 @@ int main(int argc, char **argv)
}
Model model;
try {
model = Model::read_from_file(file);
model = Model::read_from_file(file, &print_config, true);
} catch (std::exception &e) {
boost::nowide::cerr << file << ": " << e.what() << std::endl;
exit(1);
@ -226,6 +227,7 @@ int main(int argc, char **argv)
print.auto_assign_extruders(mo);
print.add_model_object(mo);
}
print_config.normalize();
print.apply_config(print_config);
std::string err = print.validate();
if (err.empty())