diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index c50bd80853..1728bc3c6b 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -791,15 +791,10 @@ void GUI_App::post_init() this->mainframe->load_config_file(this->init_params->load_configs.back()); // If loading a 3MF file, the config is loaded from the last one. if (!this->init_params->input_files.empty()) { -#if 1 // #ysFIXME_delete_after_test_of wxArrayString fns; for (const std::string& name : this->init_params->input_files) fns.Add(from_u8(name)); if (plater()->load_files(fns) && this->init_params->input_files.size() == 1) { -#else - const std::vector res = this->plater()->load_files(this->init_params->input_files, true, true); - if (!res.empty() && this->init_params->input_files.size() == 1) { -#endif // Update application titlebar when opening a project file const std::string& filename = this->init_params->input_files.front(); if (boost::algorithm::iends_with(filename, ".amf") || @@ -1247,7 +1242,6 @@ bool GUI_App::on_init_inner() if (! older_data_dir_path.empty()) { preset_bundle->import_newer_configs(older_data_dir_path); - //app_config->save(); // It looks like redundant call of save. ysFIXME delete after testing } if (is_editor()) { diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index ef3c9f766f..79135f619b 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1518,12 +1518,7 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false take_snapshot((type == ModelVolumeType::MODEL_PART) ? _L("Load Part") : _L("Load Modifier")); std::vector volumes; - // ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common - /* - if (type == ModelVolumeType::MODEL_PART) - load_part(*(*m_objects)[obj_idx], volumes, type, from_galery); - else*/ - load_modifier(input_files, *(*m_objects)[obj_idx], volumes, type, from_galery); + load_from_files(input_files, *(*m_objects)[obj_idx], volumes, type, from_galery); if (volumes.empty()) return; @@ -1543,72 +1538,9 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false selection_changed(); } -/* -void ObjectList::load_part(ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery = false) + +void ObjectList::load_from_files(const wxArrayString& input_files, ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery) { - if (type != ModelVolumeType::MODEL_PART) - return; - - wxWindow* parent = wxGetApp().tab_panel()->GetPage(0); - - wxArrayString input_files; - - if (from_galery) { - GalleryDialog dlg(this); - if (dlg.ShowModal() == wxID_CLOSE) - return; - dlg.get_input_files(input_files); - if (input_files.IsEmpty()) - return; - } - else - wxGetApp().import_model(parent, input_files); - - wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe wxPD_AUTO_HIDE); - wxBusyCursor busy; - - for (size_t i = 0; i < input_files.size(); ++i) { - std::string input_file = input_files.Item(i).ToUTF8().data(); - - dlg.Update(static_cast(100.0f * static_cast(i) / static_cast(input_files.size())), - _L("Loading file") + ": " + from_path(boost::filesystem::path(input_file).filename())); - dlg.Fit(); - - Model model; - try { - model = Model::read_from_file(input_file); - } - catch (std::exception &e) { - auto msg = _L("Error!") + " " + input_file + " : " + e.what() + "."; - show_error(parent, msg); - exit(1); - } - - for (auto object : model.objects) { - Vec3d delta = Vec3d::Zero(); - if (model_object.origin_translation != Vec3d::Zero()) { - object->center_around_origin(); - delta = model_object.origin_translation - object->origin_translation; - } - for (auto volume : object->volumes) { - volume->translate(delta); - auto new_volume = model_object.add_volume(*volume, type); - new_volume->name = boost::filesystem::path(input_file).filename().string(); - // set a default extruder value, since user can't add it manually - new_volume->config.set_key_value("extruder", new ConfigOptionInt(0)); - - added_volumes.push_back(new_volume); - } - } - } -} -*/ -void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery) -{ - // ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common - //if (type == ModelVolumeType::MODEL_PART) - // return; - wxWindow* parent = wxGetApp().tab_panel()->GetPage(0); wxProgressDialog dlg(_L("Loading") + dots, "", 100, wxGetApp().mainframe, wxPD_AUTO_HIDE); diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index b0bbb91452..f45d0e9e84 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -255,9 +255,7 @@ public: bool is_instance_or_object_selected(); bool is_selected_object_cut(); void load_subobject(ModelVolumeType type, bool from_galery = false); - // ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common - //void load_part(ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery = false); - void load_modifier(const wxArrayString& input_files, ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery = false); + void load_from_files(const wxArrayString& input_files, ModelObject& model_object, std::vector& added_volumes, ModelVolumeType type, bool from_galery = false); void load_generic_subobject(const std::string& type_name, const ModelVolumeType type); void load_shape_object(const std::string &type_name); void load_shape_object_from_gallery(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8740af3d66..cbeb377017 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -208,11 +208,9 @@ public: wxStaticText *info_size; wxStaticText *info_volume; wxStaticText *info_facets; -// wxStaticText *info_materials; wxStaticText *info_manifold; wxStaticText *label_volume; -// wxStaticText *label_materials; // ysFIXME - delete after next release if anyone will not complain about this std::vector sla_hidden_items; bool showing_manifold_warning_icon;