Fixes crash from unnamed animation sequences.

Unnamed sequences are now renamed 'ambient'. Crash found in shape models/glTF2/simple_skin/simple_skin.gltf.
This commit is contained in:
OTHGMars 2019-04-22 00:12:49 -04:00
parent 6694d5f206
commit 04355156de
2 changed files with 6 additions and 1 deletions

View file

@ -16,6 +16,10 @@ AssimpAppSequence::AssimpAppSequence(aiAnimation *a) :
seqStart(0.0f),
mAnim(a)
{
mSequenceName = mAnim->mName.C_Str();
if (mSequenceName.isEmpty())
mSequenceName = "ambient";
// From: http://sir-kimmi.de/assimp/lib_html/data.html#anims
// An aiAnimation has a duration. The duration as well as all time stamps are given in ticks.
// To get the correct timing, all time stamp thus have to be divided by aiAnimation::mTicksPerSecond.

View file

@ -22,6 +22,7 @@
class AssimpAppSequence : public AppSequence
{
String mSequenceName;
F32 seqStart;
F32 seqEnd;
@ -37,7 +38,7 @@ public:
virtual S32 getNumTriggers() const { return 0; }
virtual void getTrigger(S32 index, TSShape::Trigger& trigger) const { trigger.state = 0; }
virtual const char* getName() const { return mAnim->mName.C_Str(); }
virtual const char* getName() const { return mSequenceName.c_str(); }
F32 getStart() const { return seqStart; }
F32 getEnd() const { return seqEnd; }