Skip to content

Commit

Permalink
Support Ogre materials with spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Nov 18, 2020
1 parent 909ab3c commit 82ab597
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion gzbridge/ConfigLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@ void ConfigLoader::_parseNodes(std::ifstream &stream, ConfigNode *parent)
}
else
{
key = newNode->getName() + ' ' + newNode->getValues().front();
key = newNode->getName();
for (auto value : newNode->getValues())
{
key += ' ' + value;
}
key.erase(std::remove(key.begin(), key.end(), '"'), key.end());
}

m_scriptList.insert(ScriptItem(key, newNode));
Expand Down
2 changes: 1 addition & 1 deletion gzbridge/OgreMaterialParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::string OgreMaterialParser::GetMaterialAsJson() const
else
first = false;

std::size_t index = name.rfind(" ");
std::size_t index = name.find(" ");
if (index != std::string::npos)
{
name = name.substr(index+1);
Expand Down

0 comments on commit 82ab597

Please sign in to comment.