mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 16:29:55 +00:00
Convert underscores in bone names to whitespaces
This commit is contained in:
parent
83ee1cc582
commit
7d3f2bc113
1 changed files with 13 additions and 1 deletions
|
@ -60,7 +60,19 @@ namespace SceneUtil
|
|||
void NodeMapVisitor::apply(osg::MatrixTransform& trans)
|
||||
{
|
||||
// Take transformation for first found node in file
|
||||
const std::string nodeName = Misc::StringUtils::lowerCase(trans.getName());
|
||||
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 (foundUnderscore != std::string::npos)
|
||||
{
|
||||
std::replace(originalNodeName.begin(), originalNodeName.end(), '_', ' ');
|
||||
//originalNodeName.replace(foundUnderscore.begin(), foundPageNumberEnd - foundPageNumber - 6, " ") );
|
||||
}
|
||||
const std::string nodeName = originalNodeName;
|
||||
|
||||
mMap.emplace(nodeName, &trans);
|
||||
|
||||
traverse(trans);
|
||||
|
|
Loading…
Reference in a new issue