Merge branch 'master' into kimkulling-dev

pull/2278/head
Kim Kulling 2018-12-22 12:24:18 +01:00 committed by GitHub
commit 956f1d5347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1033,12 +1033,12 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r)
std::unordered_map<unsigned int, AnimationSamplers> samplers = GatherSamplers(anim); std::unordered_map<unsigned int, AnimationSamplers> samplers = GatherSamplers(anim);
ai_anim->mNumChannels = r.skins[0].jointNames.size(); ai_anim->mNumChannels = samplers.size();
if (ai_anim->mNumChannels > 0) { if (ai_anim->mNumChannels > 0) {
ai_anim->mChannels = new aiNodeAnim*[ai_anim->mNumChannels]; ai_anim->mChannels = new aiNodeAnim*[ai_anim->mNumChannels];
int j = 0; int j = 0;
for (auto& iter : r.skins[0].jointNames) { for (auto& iter : samplers) {
ai_anim->mChannels[j] = CreateNodeAnim(r, *iter, samplers[iter.GetIndex()]); ai_anim->mChannels[j] = CreateNodeAnim(r, r.nodes[iter.first], iter.second);
++j; ++j;
} }
} }