project-navigation
Personal tools

Author Topic: Fixed the TAG export script! Now Blender can directly export animations!  (Read 2974 times)

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
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.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
yes, please commit that