1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 22:45:36 +00:00

Limit conversion of underscores to nodes origating from osgAnimation library

This commit is contained in:
Nelsson Huotari 2021-02-02 21:41:17 +02:00
parent 2c67f34c6d
commit 1221889cf7

View file

@ -62,12 +62,15 @@ namespace SceneUtil
// Take transformation for first found node in file
std::string originalNodeName = Misc::StringUtils::lowerCase(trans.getName());
// Convert underscores to whitespaces as a workaround for Collada (OpenMW's animation system uses whitespace-separated names)
std::string underscore = "_";
std::size_t foundUnderscore = originalNodeName.find(underscore);
if (trans.libraryName() == std::string("osgAnimation"))
{
// Convert underscores to whitespaces as a workaround for Collada (OpenMW's animation system uses whitespace-separated names)
std::string underscore = "_";
std::size_t foundUnderscore = originalNodeName.find(underscore);
if (foundUnderscore != std::string::npos)
std::replace(originalNodeName.begin(), originalNodeName.end(), '_', ' ');
if (foundUnderscore != std::string::npos)
std::replace(originalNodeName.begin(), originalNodeName.end(), '_', ' ');
}
const std::string nodeName = originalNodeName;