Zero-length animations

Topics: Developer Forum
Feb 18, 2007 at 11:19 AM
Edited Feb 18, 2007 at 11:19 AM
I know it may sound odd, but I was wondering what your thoughts would be on supporting zero-length animations (i.e. ones that begin and end on the same keyframe)?

The library throws exceptions now if you try to use a one-frame animation - it tries to reference index -1 in a few arrays, etc. - and before I looked further into what would be required to support it, I wonder what you'd recommend?

Again, this is coming up in the context of working with legacy .x files which I can't re-export. Otherwise I would make the one-frame animations into two-frame animations, which, alas, isn't an option.
Feb 18, 2007 at 8:14 PM
Using "reference poses" as they are called is pretty common, but for some reason I overlooked one-frame animations being used for this. I think this will require some code editing.
Feb 18, 2007 at 8:30 PM
Well, as usual, there is a hack fix you can do in the latest source code. You can make a processor that subclasses AnimatedModelProcessor and just duplicate the first frame in each animation in the overrided ProcessAnimation method.

However, this is an easy fix so if you aren't comfortable with the pipeline I'd just wait.
Feb 18, 2007 at 9:21 PM
Ok, I fixed it and checked in the fixed source.

It was easy to fix after all - all I had to do is change a "<" to a "<="
Feb 18, 2007 at 10:32 PM
Thanks very much Dastle!! I will check out the source (and remove the hacks from my code) :)