Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default name assignment to animations without names #413

Merged
merged 5 commits into from
Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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