UFO:Alien Invasion

Development => Coding => Topic started by: Destructavator on March 10, 2010, 07:30:40 am

Title: Fixed the TAG export script! Now Blender can directly export animations!
Post by: Destructavator on March 10, 2010, 07:30:40 am
As I said in the bug-tracker:

https://sourceforge.net/tracker/?func=detail&atid=805242&aid=2967149&group_id=157793

I found the bug, I fixed the bug!   ;D

...And to top it off, I did it in the python language which I never learned or even touched before!

Now I can directly export MD2 models and TAG files that work properly straight from Blender.  I ran several tests, it works beautifully now.

Should I go ahead and commit the fixed script to the trunk?

(I'll also attach it to this post.)

The problem is that the built-in MD2 exporter in the latest stable version of Blender exports frames that are off by just one compared to the TAG export script.  One starts counting at zero, the other at one.  The solution is to get both to count from the same value.

I tracked it down to line 507:
Code: [Select]
Blender.Set("curframe", current_frame)
...and changed it to:

Code: [Select]
Blender.Set("curframe", current_frame - 1)
...and now everything lines up properly in-game.
Title: Re: Fixed the TAG export script! Now Blender can directly export animations!
Post by: Mattn on March 10, 2010, 10:52:33 am
yes, please commit that