From b6535ba5c9d29a1b63c4433ae5788e503790cea7 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Wed, 28 Oct 2020 09:35:44 -0400 Subject: [PATCH] add more animation debug info --- examples/assimp_loading/animation_testing.cpp | 20 +++++++++++++++++++ include/dumbLog.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/examples/assimp_loading/animation_testing.cpp b/examples/assimp_loading/animation_testing.cpp index 91e307b..ae743bc 100644 --- a/examples/assimp_loading/animation_testing.cpp +++ b/examples/assimp_loading/animation_testing.cpp @@ -7,6 +7,7 @@ #include #include "dumbLog.h" +#include "mesh.h" void @@ -34,5 +35,24 @@ logDebugAnimationInfo(const char* model_name) std::cout << "\n\n--------------------------------------\n"; aiMatrix4x4 identity_mat; debugParseNode(scene->mRootNode, identity_mat); + std::cout << "--------------------------------------\n"; + + if (scene->HasAnimations()) { + aiAnimation* anim = scene->mAnimations[0]; + std::cout << "Animation, ticks/s: " << anim->mTicksPerSecond + << ", duration: " << anim->mDuration + << ", channels: " << anim->mNumChannels + << "\n"; + + for (uint i = 0; i < anim->mNumChannels; i++) { + aiNodeAnim* chan = anim->mChannels[i]; + std::cout << "channel, node name: " << chan->mNodeName.C_Str() + << ", mNumPositionKeys: " << chan->mNumPositionKeys + << ", mNumRotationKeys: " << chan->mNumRotationKeys + << ", mNumScalingKeys: " << chan->mNumScalingKeys + << "\n"; + } + } + std::cout << "--------------------------------------\n\n\n"; } diff --git a/include/dumbLog.h b/include/dumbLog.h index 44a43a8..769cfa4 100644 --- a/include/dumbLog.h +++ b/include/dumbLog.h @@ -1,4 +1,6 @@ +#pragma once + #include #include