Skip to content

Commit bb7d9fd

Browse files
authored
add callable init (#374)
1 parent a496ad7 commit bb7d9fd

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

Plugin/src/SofaPython3/initModule.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "PythonEnvironment.h"
2424
using sofapython3::PythonEnvironment;
2525

26+
#include <SofaPython3/initModule.h>
27+
2628
#include <sofa/core/init.h>
2729
#include <sofa/defaulttype/init.h>
2830
#include <sofa/simulation/init.h>
@@ -44,11 +46,11 @@ void initExternalModule()
4446
static bool first = true;
4547
if (first)
4648
{
47-
sofa::core::init();
49+
sofa::helper::init();
4850
sofa::defaulttype::init();
51+
sofa::core::init();
4952
sofa::simulation::core::init();
5053
sofa::simulation::graph::init();
51-
sofa::helper::init();
5254

5355
PythonEnvironment::Init();
5456
first = false;
@@ -87,3 +89,11 @@ bool moduleIsInitialized()
8789
}
8890

8991
}
92+
93+
namespace sofapython3
94+
{
95+
void init()
96+
{
97+
initExternalModule();
98+
}
99+
}

Plugin/src/SofaPython3/initModule.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222

2323
#include <SofaPython3/config.h>
2424

25-
25+
namespace sofapython3
26+
{
27+
SOFAPYTHON3_API void init();
28+
}

0 commit comments

Comments
 (0)