Commit 54412f97 authored by cutealien's avatar cutealien

Reduce amount of logging output in skinned mesh loading a little bit.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4896 dfc29bdd-3216-0410-991c-e03cc46cb475
parent e85720d8
...@@ -1017,6 +1017,13 @@ void CSkinnedMesh::finalize() ...@@ -1017,6 +1017,13 @@ void CSkinnedMesh::finalize()
if (HasAnimation) if (HasAnimation)
{ {
irr::u32 redundantPosKeys = 0;
irr::u32 unorderedPosKeys = 0;
irr::u32 redundantScaleKeys = 0;
irr::u32 unorderedScaleKeys = 0;
irr::u32 redundantRotationKeys = 0;
irr::u32 unorderedRotationKeys = 0;
//--- optimize and check keyframes --- //--- optimize and check keyframes ---
for(i=0;i<AllJoints.size();++i) for(i=0;i<AllJoints.size();++i)
{ {
...@@ -1024,44 +1031,14 @@ void CSkinnedMesh::finalize() ...@@ -1024,44 +1031,14 @@ void CSkinnedMesh::finalize()
core::array<SScaleKey> &ScaleKeys = AllJoints[i]->ScaleKeys; core::array<SScaleKey> &ScaleKeys = AllJoints[i]->ScaleKeys;
core::array<SRotationKey> &RotationKeys = AllJoints[i]->RotationKeys; core::array<SRotationKey> &RotationKeys = AllJoints[i]->RotationKeys;
// drop identical middle keys - we only need the first and last frame // redundant = identical middle keys - we only need the first and last frame
irr::u32 dropped = dropMiddleKeys<SPositionKey>(PositionKeys, identicalPos); // unordered = frames which are out of order - we can't handle those
if ( dropped > 0 ) redundantPosKeys += dropMiddleKeys<SPositionKey>(PositionKeys, identicalPos);
{ unorderedPosKeys += dropBadKeys<SPositionKey>(PositionKeys);
os::Printer::log("Skinned Mesh - unneeded position frames kicked:", core::stringc(dropped).c_str(), ELL_DEBUG); redundantScaleKeys += dropMiddleKeys<SScaleKey>(ScaleKeys, identicalScale);
} unorderedScaleKeys += dropBadKeys<SScaleKey>(ScaleKeys);
redundantRotationKeys += dropMiddleKeys<SRotationKey>(RotationKeys, identicalRotation);
// drop frames with bad keys (frames out of order) unorderedRotationKeys += dropBadKeys<SRotationKey>(RotationKeys);
dropped = dropBadKeys<SPositionKey>(PositionKeys);
if ( dropped > 0 )
{
irr::os::Printer::log("Skinned Mesh - bad position frames kicked:", irr::core::stringc(dropped).c_str(), irr::ELL_DEBUG);
}
dropped = dropMiddleKeys<SScaleKey>(ScaleKeys, identicalScale);
if ( dropped > 0 )
{
os::Printer::log("Skinned Mesh - unneeded scale frames kicked:", core::stringc(dropped).c_str(), ELL_DEBUG);
}
dropped = dropBadKeys<SScaleKey>(ScaleKeys);
if ( dropped > 0 )
{
irr::os::Printer::log("Skinned Mesh - bad scale frames kicked:", irr::core::stringc(dropped).c_str(), irr::ELL_DEBUG);
}
dropped = dropMiddleKeys<SRotationKey>(RotationKeys, identicalRotation);
if ( dropped > 0 )
{
os::Printer::log("Skinned Mesh - unneeded rotation frames kicked:", core::stringc(dropped).c_str(), ELL_DEBUG);
}
dropped = dropBadKeys<SRotationKey>(RotationKeys);
if ( dropped > 0 )
{
irr::os::Printer::log("Skinned Mesh - bad rotation frames kicked:", irr::core::stringc(dropped).c_str(), irr::ELL_DEBUG);
}
//Fill empty keyframe areas //Fill empty keyframe areas
if (PositionKeys.size()) if (PositionKeys.size())
...@@ -1124,6 +1101,31 @@ void CSkinnedMesh::finalize() ...@@ -1124,6 +1101,31 @@ void CSkinnedMesh::finalize()
} }
} }
} }
if ( redundantPosKeys > 0 )
{
os::Printer::log("Skinned Mesh - redundant position frames kicked:", core::stringc(redundantPosKeys).c_str(), ELL_DEBUG);
}
if ( unorderedPosKeys > 0 )
{
irr::os::Printer::log("Skinned Mesh - unsorted position frames kicked:", irr::core::stringc(unorderedPosKeys).c_str(), irr::ELL_DEBUG);
}
if ( redundantScaleKeys > 0 )
{
os::Printer::log("Skinned Mesh - redundant scale frames kicked:", core::stringc(redundantScaleKeys).c_str(), ELL_DEBUG);
}
if ( unorderedScaleKeys > 0 )
{
irr::os::Printer::log("Skinned Mesh - unsorted scale frames kicked:", irr::core::stringc(unorderedScaleKeys).c_str(), irr::ELL_DEBUG);
}
if ( redundantRotationKeys > 0 )
{
os::Printer::log("Skinned Mesh - redundant rotation frames kicked:", core::stringc(redundantRotationKeys).c_str(), ELL_DEBUG);
}
if ( unorderedRotationKeys > 0 )
{
irr::os::Printer::log("Skinned Mesh - unsorted rotation frames kicked:", irr::core::stringc(unorderedRotationKeys).c_str(), irr::ELL_DEBUG);
}
} }
//Needed for animation and skinning... //Needed for animation and skinning...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment