mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Added naming of the new(fixed) object
+ fixed inconsistency of parameters inside fix_model_by_win10_sdk_gui()
This commit is contained in:
parent
9e8e5761a9
commit
6d60ecffa0
1 changed files with 5 additions and 3 deletions
|
@ -347,8 +347,9 @@ void fix_model_by_win10_sdk_gui(const ModelObject &model_object, const Print &pr
|
||||||
boost::filesystem::path path_src = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();
|
boost::filesystem::path path_src = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();
|
||||||
path_src += ".3mf";
|
path_src += ".3mf";
|
||||||
Model model;
|
Model model;
|
||||||
|
DynamicPrintConfig config;
|
||||||
model.add_object(model_object);
|
model.add_object(model_object);
|
||||||
if (! Slic3r::store_3mf(path_src.string().c_str(), &model, const_cast<Print*>(&print), false)) {
|
if (! Slic3r::store_3mf(path_src.string().c_str(), &model, &config/*const_cast<Print*>(&print), false*/)) {
|
||||||
boost::filesystem::remove(path_src);
|
boost::filesystem::remove(path_src);
|
||||||
throw std::runtime_error(L("Export of a temporary 3mf file failed"));
|
throw std::runtime_error(L("Export of a temporary 3mf file failed"));
|
||||||
}
|
}
|
||||||
|
@ -359,9 +360,10 @@ void fix_model_by_win10_sdk_gui(const ModelObject &model_object, const Print &pr
|
||||||
fix_model_by_win10_sdk(path_src.string().c_str(), path_dst.string(), on_progress,
|
fix_model_by_win10_sdk(path_src.string().c_str(), path_dst.string(), on_progress,
|
||||||
[&canceled]() { if (canceled) throw RepairCanceledException(); });
|
[&canceled]() { if (canceled) throw RepairCanceledException(); });
|
||||||
boost::filesystem::remove(path_src);
|
boost::filesystem::remove(path_src);
|
||||||
DynamicPrintConfig config;// PresetBundle bundle;
|
// PresetBundle bundle;
|
||||||
on_progress(L("Loading the repaired model"), 80);
|
on_progress(L("Loading the repaired model"), 80);
|
||||||
bool loaded = Slic3r::load_3mf(path_dst.string().c_str(), &config/*bundle*/, &result);
|
bool loaded = Slic3r::load_3mf(path_dst.string().c_str(), &config/*bundle*/, &result);
|
||||||
|
result.objects[0]->name = boost::filesystem::path(model_object.name).filename().stem().string() + "_fixed";
|
||||||
boost::filesystem::remove(path_dst);
|
boost::filesystem::remove(path_dst);
|
||||||
if (! loaded)
|
if (! loaded)
|
||||||
throw std::runtime_error(L("Import of the repaired 3mf file failed"));
|
throw std::runtime_error(L("Import of the repaired 3mf file failed"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue