Automatic selection of newly loaded objects

This commit is contained in:
Enrico Turri 2019-01-03 09:12:50 +01:00
parent c4d5c7cefd
commit d426895580

View file

@ -1503,6 +1503,17 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
statusbar()->set_status_text(_(L("Loaded")));
}
// automatic selection of added objects
if (!obj_idxs.empty() && (view3D != nullptr))
{
GLCanvas3D::Selection& selection = view3D->get_canvas3d()->get_selection();
selection.clear();
for (size_t idx : obj_idxs)
{
selection.add_object((unsigned int)idx, false);
}
}
return obj_idxs;
}