FIX: [STUDIO-2908] load files from command line

Change-Id: Icd67714f684bf150c568956e0685e67dca9e2ca8
This commit is contained in:
chunmao.guo authored and Lane.Wei committed 2023-07-07 17:25:51 +08:00
1 parent d53bd3394a
commit 84eb6159aa
2 files changed
+7 -13

No files matched your search

+5 -12
View File
@@ -1048,19 +1048,12 @@ void GUI_App::post_init()
else {
mainframe->select_tab(size_t(MainFrame::tp3DEditor));
plater_->select_view_3D("3D");
Plater::TakeSnapshot snapshot(this->plater(), "Load Project", UndoRedo::SnapshotType::ProjectSeparator);
const std::vector<size_t> res = this->plater()->load_files(this->init_params->input_files);
if (!res.empty()) {
if (this->init_params->input_files.size() == 1) {
// Update application titlebar when opening a project file
const std::string& filename = this->init_params->input_files.front();
this->plater()->up_to_date(true, false);
this->plater()->up_to_date(true, true);
//BBS: remove amf logic as project
if (boost::algorithm::iends_with(filename, ".3mf"))
this->plater()->set_project_filename(from_u8(filename));
}
wxArrayString input_files;
for (auto & file : this->init_params->input_files) {
input_files.push_back(file);
}
this->plater()->set_project_filename(_L("Untitled"));
this->plater()->load_files(input_files);
}
}
}