From 6c16e8123f828699a363065297f6a8abdffdbd0b Mon Sep 17 00:00:00 2001 From: remibessard Date: Mon, 8 Sep 2025 09:43:55 +0200 Subject: [PATCH 1/2] Update Node: A node name can now be surrounded by quotation marks (allow node names with / , e.g. \'/universe/base\') --- .../Core/src/sofa/simulation/Node.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp index 37753fa3d0c..1ada3fc508b 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp @@ -508,10 +508,21 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: } else { - std::size_t p2pos = pathStr.find('/',ppos); - if (p2pos == std::string::npos) p2pos = psize; - std::string nameStr = pathStr.substr(ppos,p2pos-ppos); - ppos = p2pos+1; + std::string name; + if (pathStr[ppos] == '\'') + { + std::size_t p2pos = pathStr.find('\'', ppos + 1); + if (p2pos == std::string::npos) p2pos = psize; + name = pathStr.substr(ppos, p2pos - ppos+1); + ppos = p2pos + 2; + } + else + { + std::size_t p2pos = pathStr.find('/',ppos); + if (p2pos == std::string::npos) p2pos = psize; + name = pathStr.substr(ppos,p2pos-ppos); + ppos = p2pos+1; + } if (master) { if(DEBUG_LINK) From c38f4a79b6386b49fe85f2961ffcfc2cf16cb3a0 Mon Sep 17 00:00:00 2001 From: remibessard Date: Thu, 11 Dec 2025 11:29:47 +0100 Subject: [PATCH 2/2] Fix: Rename variable 'name' to 'nameStr' in Node.cpp --- Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp index 1ada3fc508b..c899452b720 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp @@ -508,19 +508,19 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: } else { - std::string name; + std::string nameStr; if (pathStr[ppos] == '\'') { std::size_t p2pos = pathStr.find('\'', ppos + 1); if (p2pos == std::string::npos) p2pos = psize; - name = pathStr.substr(ppos, p2pos - ppos+1); + nameStr = pathStr.substr(ppos, p2pos - ppos+1); ppos = p2pos + 2; } else { std::size_t p2pos = pathStr.find('/',ppos); if (p2pos == std::string::npos) p2pos = psize; - name = pathStr.substr(ppos,p2pos-ppos); + nameStr = pathStr.substr(ppos,p2pos-ppos); ppos = p2pos+1; } if (master)