Merge pull request #1837 from gonchar/master

Support Maya 2018 Collada Export
pull/1843/head
Kim Kulling 2018-03-18 23:34:09 +01:00 committed by GitHub
commit 3390185270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -222,6 +222,7 @@ void ColladaParser::ReadStructure()
} }
PostProcessRootAnimations(); 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 // Re-build animations from animation clip library, if present, otherwise combine single-channel animations
void ColladaParser::PostProcessRootAnimations() void ColladaParser::PostProcessRootAnimations()

View File

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