Quantcast
Channel: The VG Resource - All Forums
Viewing all articles
Browse latest Browse all 16318

Blender Add-On for direct BFRES import (WIP / only code yet!)

$
0
0
If you are not a developer: There's not much to see yet except pure Python code! I'll write the parts to make the loaded stuff visible next, maybe with the help of some geniuses here, stay tuned!

[Image: import.png]
Something very easily done in Blender (except for the smiley!) and nothing special, just for visualization purposes

If you are a developer:
I started an add-on to directly import BFRES files into Blender yesterday, open source of course, on Github.
With the last commit today, it completely loads the FMDL sections into well defined structures (it is prepared for FTEX and embedded files already by loading the headers and data).
The part to actually place that data into Blender objects and meshes to make them visible is not yet done but of course the next logical step!

Of course I could've just jumped from offset to offset to fetch the parts I need for displaying model data, like RTB's (really cool, no flame intended!) MaxScript does; but I want the Blender add-on to...
  • prefer correctness over speed (still fast, loading track file in 3-4 seconds... Yaz0 decompression still a little slow with 40 seconds for a track... will be optimized),
  • be more flexible to extend,
  • be less error-prone and easier to fix,
  • decompress Yaz0 on the fly in the future, done!
  • directly extract and convert FTEX textures too if possible,
  • become (and now I'm looking really far into the future) part of the core of a complete Mario Kart 8 track importer add-on.
It is less a port of my C# library I once wrote for loading BFRES, more a complete rewrite of it to make it easier to export BFRES neversomewhen, the offset bigotry being the biggest problem in a managed language like Python (e.g., I put the headers, which are kept separate in BFRES files in their own structs, rather than that weird Internals approach I used in C#).

Make sure to check bfres_file.py, it contains a huge comment visualizing the BFRES format, something the MK8 wiki doesn't deliver so well.

I really need the help of some other BFRES pros here at some point. Especially looking at RTB to help me out with the additional vertex buffer attribute formats he discovered and which I didn't find documented anywhere, as they're pretty common (I'm not a MaxScript expert so extracting that information out of that script is kinda tedious and error-prone).

Viewing all articles
Browse latest Browse all 16318

Trending Articles