Skip to content

Commit

Permalink
Default name assignment to animations without names (#413)
Browse files Browse the repository at this point in the history
Signed-off-by: Onur Berk Tore <[email protected]>
Co-authored-by: Onur Berk Tore <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
Co-authored-by: Luca Della Vedova <[email protected]>
  • Loading branch information
4 people authored Oct 26, 2022
1 parent cfff058 commit 9ece5b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,17 @@ Mesh *AssimpLoader::Load(const std::string &_filename)
// Recursive call to keep track of transforms,
// mesh is passed by reference and edited throughout
this->dataPtr->RecursiveCreate(scene, rootNode, rootTransform, mesh);
auto rootSkeleton = mesh->MeshSkeleton();
// Add the animations
for (unsigned animIdx = 0; animIdx < scene->mNumAnimations; ++animIdx)
{
auto& anim = scene->mAnimations[animIdx];
auto animName = ToString(anim->mName);
if (animName.empty())
{
animName = "animation" +
std::to_string(rootSkeleton->AnimationCount() + 1);
}
SkeletonAnimation* skelAnim = new SkeletonAnimation(animName);
for (unsigned chanIdx = 0; chanIdx < anim->mNumChannels; ++chanIdx)
{
Expand Down

0 comments on commit 9ece5b5

Please sign in to comment.