Support Maya 2018 Collada Export with blendshapes and bones controllers for a mesh

pull/1837/head
Sergey Gonchar 2018-03-15 21:41:40 -07:00
parent 9444935ce8
commit 2d980c16f0
2 changed files with 19 additions and 0 deletions

View File

@ -222,6 +222,7 @@ void ColladaParser::ReadStructure()
}
PostProcessRootAnimations();
PostProcessControllers();
}
// ------------------------------------------------------------------------------------------------
@ -360,6 +361,21 @@ void ColladaParser::ReadAnimationClipLibrary()
}
}
void ColladaParser::PostProcessControllers()
{
for (ControllerLibrary::iterator it = mControllerLibrary.begin(); it != mControllerLibrary.end(); ++it)
{
std::string meshId = it->second.mMeshId;
ControllerLibrary::iterator findItr = mControllerLibrary.find(meshId);
while(findItr != mControllerLibrary.end()) {
meshId = findItr->second.mMeshId;
findItr = mControllerLibrary.find(meshId);
}
it->second.mMeshId = meshId;
}
}
// ------------------------------------------------------------------------------------------------
// Re-build animations from animation clip library, if present, otherwise combine single-channel animations
void ColladaParser::PostProcessRootAnimations()

View File

@ -87,6 +87,9 @@ namespace Assimp
/** Reads the animation clip library */
void ReadAnimationClipLibrary();
/** Unwrap controllers dependency hierarchy */
void PostProcessControllers();
/** Re-build animations from animation clip library, if present, otherwise combine single-channel animations */
void PostProcessRootAnimations();