|
@@ -255,42 +255,26 @@ void AssimpShapeLoader::enumerateScene()
|
|
|
|
|
|
void AssimpShapeLoader::processAnimations()
|
|
void AssimpShapeLoader::processAnimations()
|
|
{
|
|
{
|
|
- bool ambient = false;
|
|
|
|
- for(U32 n = 0; n < mScene->mNumAnimations; ++n)
|
|
|
|
- {
|
|
|
|
- Con::printf("[ASSIMP] Animation Found: %s", mScene->mAnimations[n]->mName.C_Str());
|
|
|
|
-
|
|
|
|
- if (mScene->mAnimations[n]->mName.C_Str() == "ambient")
|
|
|
|
- ambient = true;
|
|
|
|
|
|
+ // add all animations into 1 ambient animation.
|
|
|
|
+ aiAnimation* ambientSeq = new aiAnimation();
|
|
|
|
+ ambientSeq->mName = "ambient";
|
|
|
|
|
|
- AssimpAppSequence* newAssimpSeq = new AssimpAppSequence(mScene->mAnimations[n]);
|
|
|
|
- appSequences.push_back(newAssimpSeq);
|
|
|
|
- }
|
|
|
|
|
|
+ Vector<aiNodeAnim*> ambientChannels;
|
|
|
|
|
|
- // dont have ambient, lets just add everything to an ambient sequence.
|
|
|
|
- // we should probably just do this as default.
|
|
|
|
- if (!ambient)
|
|
|
|
|
|
+ for (U32 i = 0; i < mScene->mNumAnimations; ++i)
|
|
{
|
|
{
|
|
- aiAnimation* ambientSeq = new aiAnimation();
|
|
|
|
- ambientSeq->mName = "ambient";
|
|
|
|
-
|
|
|
|
- Vector<aiNodeAnim*> ambientChannels;
|
|
|
|
-
|
|
|
|
- for (U32 i = 0; i < mScene->mNumAnimations; ++i)
|
|
|
|
|
|
+ aiAnimation* anim = mScene->mAnimations[i];
|
|
|
|
+ for (U32 j = 0; j < anim->mNumChannels; j++)
|
|
{
|
|
{
|
|
- aiAnimation* anim = mScene->mAnimations[i];
|
|
|
|
- for (U32 j = 0; j < anim->mNumChannels; j++)
|
|
|
|
- {
|
|
|
|
- ambientChannels.push_back(anim->mChannels[j]);
|
|
|
|
- }
|
|
|
|
|
|
+ ambientChannels.push_back(anim->mChannels[j]);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- ambientSeq->mNumChannels = ambientChannels.size();
|
|
|
|
- ambientSeq->mChannels = ambientChannels.address();
|
|
|
|
|
|
+ ambientSeq->mNumChannels = ambientChannels.size();
|
|
|
|
+ ambientSeq->mChannels = ambientChannels.address();
|
|
|
|
|
|
- AssimpAppSequence* defaultAssimpSeq = new AssimpAppSequence(ambientSeq);
|
|
|
|
- appSequences.push_back(defaultAssimpSeq);
|
|
|
|
- }
|
|
|
|
|
|
+ AssimpAppSequence* defaultAssimpSeq = new AssimpAppSequence(ambientSeq);
|
|
|
|
+ appSequences.push_back(defaultAssimpSeq);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|