Skip to content

Commit

Permalink
load optional guis glfw,imgui at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy committed Nov 9, 2023
1 parent bb7d9fd commit fba5642
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bindings/SofaGui/src/SofaPython3/SofaGui/Module_SofaGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ PYBIND11_MODULE(Gui, m) {
sofa::gui::headlessrecorder::init();
#endif

const auto listAdditionalGUIs = { "SofaGLFW", "SofaImGui" };

for (const auto& gui : listAdditionalGUIs)
{
try
{
py::module_ sys = py::module_::import(gui);
}
catch (const py::error_already_set& e)
{
dmsg_info("Sofa.Gui") << gui << " could not be loaded. Reason: " << e.what();
}
}

sofa::core::init();

moduleAddBaseGui(m);
Expand Down

0 comments on commit fba5642

Please sign in to comment.