Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Plugin/src/SofaPython3/SceneLoaderPY3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ void SceneLoaderPY3::getExtensionList(ExtensionList* list)
list->push_back("py");
}

bool SceneLoaderPY3::syntaxForAddingRequiredPlugin(const std::string& pluginName,
const std::vector<std::string>& listComponents, std::ostream& ss, sofa::simulation::Node* nodeWhereAdded)
{
ss << nodeWhereAdded->getName() << ".addObject('RequiredPlugin', name='" << pluginName << "')";
if (!listComponents.empty())
{
ss << " # Needed to use components [" << sofa::helper::join(listComponents, ',');
}
ss << "]" << msgendl;
return true;
}

sofa::simulation::Node::SPtr SceneLoaderPY3::doLoad(const std::string& filename, const std::vector<std::string>& sceneArgs)
{
sofa::simulation::Node::SPtr root = sofa::simulation::Node::create("root");
Expand All @@ -100,7 +112,7 @@ void SceneLoaderPY3::loadSceneWithArguments(const char *filename,

if(!py::hasattr(module, "createScene"))
{
msg_error() << "Missing createScene function";
msg_error("SofaPython3") << "Missing createScene function";
return ;
}

Expand Down
3 changes: 3 additions & 0 deletions Plugin/src/SofaPython3/SceneLoaderPY3.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class SOFAPYTHON3_API SceneLoaderPY3 : public SceneLoader

/// get the list of file extensions
virtual void getExtensionList(ExtensionList* list) override;

bool syntaxForAddingRequiredPlugin(const std::string& pluginName, const std::vector<std::string>& listComponents,
std::ostream& ss, sofa::simulation::Node* nodeWhereAdded) override;
};

} // namespace sofapython3