Users browsing this thread: 2 Guest(s)
Blender Add-On for direct BFRES import (WIP!)
#1
I started an add-on to directly import BFRES files into Blender some days ago. There's some stuff to see in follow-up posts by now. I'll write the missing parts next, maybe with the help of some geniuses here, stay tuned!

You can alpha test the add-on, if you are brave enough! The installation details and the files are all on the GitHub repository here.

If you are a developer:
By now it completely loads the FMDL sections into well defined structures and creates the resulting models and materials.

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),
  • be more flexible to extend,
  • be less error-prone and easier to fix,
  • decompress Yaz0 on the fly in the future, done! as fast as Python can (12 seconds for a track file on my PC)
  • directly extract and convert FTEX textures too if possible (and if not, delegate the work to TexConv2 or call into its TexUtils DLL with a path set up in the options), done! (using TexConv2 at the moment)
  • 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#).

Need a quick overview for getting started developing with it? There are some helpful comment sections here and there.
  • 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.
  • If you want to know more about the way you have to go to get the vertex data for a model, I wrote a comment about it in bfres_fmdl.py.
Reply


Messages In This Thread
Blender Add-On for direct BFRES import (WIP!) - by Ray Koopa - 05-22-2016, 08:53 AM

Forum Jump: