- fbx: drop empty animation stacks to pass assimp validation.
parent
6ea67963ba
commit
8d1db6229c
|
@ -914,7 +914,12 @@ private:
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void ConvertAnimationStack(const AnimationStack& st)
|
void ConvertAnimationStack(const AnimationStack& st)
|
||||||
{
|
{
|
||||||
|
const AnimationLayerList& layers = st.Layers();
|
||||||
|
if(layers.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
aiAnimation* const anim = new aiAnimation();
|
aiAnimation* const anim = new aiAnimation();
|
||||||
animations.push_back(anim);
|
animations.push_back(anim);
|
||||||
|
|
||||||
|
@ -925,7 +930,6 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
anim->mName.Set(name);
|
anim->mName.Set(name);
|
||||||
const AnimationLayerList& layers = st.Layers();
|
|
||||||
|
|
||||||
// need to find all nodes for which we need to generate node animations -
|
// need to find all nodes for which we need to generate node animations -
|
||||||
// it may happen that we need to merge multiple layers, though.
|
// it may happen that we need to merge multiple layers, though.
|
||||||
|
@ -1066,6 +1070,13 @@ private:
|
||||||
|
|
||||||
std::swap_ranges(node_anims.begin(),node_anims.end(),anim->mChannels);
|
std::swap_ranges(node_anims.begin(),node_anims.end(),anim->mChannels);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// empty animations would fail validation, so drop them
|
||||||
|
delete anim;
|
||||||
|
animations.pop_back();
|
||||||
|
FBXImporter::LogInfo("ignoring empty AnimationStack: " + name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// for some mysterious reason, mDuration is simply the maximum key -- the
|
// for some mysterious reason, mDuration is simply the maximum key -- the
|
||||||
// validator always assumes animations to start at zero.
|
// validator always assumes animations to start at zero.
|
||||||
|
|
Loading…
Reference in New Issue