From e6f9011a300a0f1fe54f6949185a10c373dedf22 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 19 Mar 2026 11:53:38 +0100 Subject: [PATCH] [Simulation.Core] Add warning if RequiredPlugin uses its name to load a plugin --- .../Core/src/sofa/simulation/RequiredPlugin.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/RequiredPlugin.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/RequiredPlugin.cpp index 32e49c43ebe..8a8e0c8185e 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/RequiredPlugin.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/RequiredPlugin.cpp @@ -110,7 +110,18 @@ bool RequiredPlugin::loadPlugin() /// In case the pluginName is not set we copy the provided name into the set to load. if(!d_pluginName.isSet() && name.isSet()) { - pluginsToLoad.push_back(this->getName()); + const auto componentName = this->getName(); + { + const auto considerNameAsPluginName = FileSystem::cleanPath(componentName); + if (FileSystem::isFile(considerNameAsPluginName) || !pluginManager.findPlugin(considerNameAsPluginName).empty()) + { + msg_deprecated() << "The name of the plugin to load (" << componentName + << ") must be defined in the Data '" << d_pluginName.getName() + << "', not in the the Data '" << this->name.getName() << "'. The plugin '" + << componentName << "' may be loaded, but this may change in the future."; + } + } + pluginsToLoad.push_back(componentName); } type::vector< std::string > failed;