Skip to content

Commit 42b2b2d

Browse files
committed
allow imgui to be spawned (eventually) by sofapython3
1 parent d1f3d5f commit 42b2b2d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

SofaImGui/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ set(SOFAIMGUI_SOURCE_DIR src/SofaImGui)
7979

8080
set(HEADER_FILES
8181
${SOFAIMGUI_SOURCE_DIR}/config.h.in
82+
${SOFAIMGUI_SOURCE_DIR}/init.h
8283
${SOFAIMGUI_SOURCE_DIR}/ImGuiDataWidget.h
8384
${SOFAIMGUI_SOURCE_DIR}/ImGuiGUI.h
8485
${SOFAIMGUI_SOURCE_DIR}/ImGuiGUIEngine.h

SofaImGui/src/SofaImGui/ImGuiGUI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ sofa::gui::common::BaseGUI* ImGuiGUI::CreateGUI(const char* name, sofa::simulati
4949
{
5050
return nullptr;
5151
}
52+
53+
gui->setScene(groot, filename);
54+
5255
return gui;
5356
}
5457

SofaImGui/src/SofaImGui/initSofaImGui.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* *
2020
* Contact information: contact@sofa-framework.org *
2121
******************************************************************************/
22-
#include <SofaImGui/config.h>
22+
#include <SofaImGui/init.h>
2323

2424
#include <sofa/simulation/Node.h>
2525
#include <sofa/gui/common/GUIManager.h>
@@ -78,4 +78,9 @@ const char* getModuleComponentList()
7878
return "";
7979
}
8080

81+
void init()
82+
{
83+
initExternalModule();
84+
}
85+
8186
} // namespace sofaimgui

0 commit comments

Comments
 (0)