File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
bindings/SofaRuntime/src/SofaPython3/SofaRuntime Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -132,15 +132,25 @@ PYBIND11_MODULE(SofaRuntime, m) {
132132 {
133133 std::string configPluginPath = " plugin_list.conf" ;
134134 std::string defaultConfigPluginPath = " plugin_list.conf.default" ;
135+
136+ sofa::type::vector<std::string> loadedPlugins;
135137 if (sofa::helper::system::PluginRepository.findFile (configPluginPath, " " , nullptr ))
136138 {
137139 msg_info (" SofaRuntime" ) << " Loading automatically plugin list in " << configPluginPath;
138- sofa::helper::system::PluginManager::getInstance ().readFromIniFile (configPluginPath);
140+ sofa::helper::system::PluginManager::getInstance ().readFromIniFile (configPluginPath, loadedPlugins );
139141 }
140142 if (sofa::helper::system::PluginRepository.findFile (defaultConfigPluginPath, " " , nullptr ))
141143 {
142144 msg_info (" SofaRuntime" ) << " Loading automatically plugin list in " << defaultConfigPluginPath;
143- sofa::helper::system::PluginManager::getInstance ().readFromIniFile (defaultConfigPluginPath);
145+ sofa::helper::system::PluginManager::getInstance ().readFromIniFile (defaultConfigPluginPath, loadedPlugins);
146+ }
147+
148+ if (sofa::core::ObjectFactory* objectFactory = sofa::core::ObjectFactory::getInstance ())
149+ {
150+ for (const auto & pluginName : loadedPlugins)
151+ {
152+ objectFactory->registerObjectsFromPlugin (pluginName);
153+ }
144154 }
145155 }, " automatically load plugins from configuration files" );
146156
You can’t perform that action at this time.
0 commit comments