N64-Sausage64 icon indicating copy to clipboard operation
N64-Sausage64 copied to clipboard

Blender S64 importing plugin

Open naclomi opened this issue 2 years ago • 1 comments

Hello! Firstly, thank you for the spectacular work on this modeling ecosystem :)

I was wondering if you had any plans to write a Blender plugin to import S64 files?

I'm working on modding tools for the N64 release of Glover and the S64 format is perfectly suited to its actor data, but as-is I'm not sure if any modeling tools can read the format and it would be nice to have symmetry between the asset import and export workflows.

naclomi avatar Apr 06 '22 02:04 naclomi

Hi, thanks for your interest in the project :smile:

I hadn't really considered it, especially because I've never messed with Blender's model import API. It can be done in the distant future, but definitely low priority for me.

I have been slacking off on a model previewer though. There's an issue with the model scaling on the N64 side of the library, and when I was cleaning up files I accidentally binned my previous preview tool. Been procrastinating it ever since :weary:

buu342 avatar Apr 06 '22 03:04 buu342

Two years late on this, but I have basically begun work on an import plugin: f7c7417

Apologies for the silence, but I have been finishing my Masters degree, so I put all of my personal project stuff on hold until that was done. Now I'm tackling some Sausage64 stuff to get back into the swing of doing N64 related work, and this is something I'm currently working on.

The commit I made will read and parse the S64 file perfectly, now I just need to actually make it generate the meshes in Blender, and to animate them.

Now, since the S64 exporter doesn't export everything, the import process is somewhat lossy. One thing that isn't exported currently is bone parenting, because the library was designed to avoid the matrix stack in order to work around potential stack depth limitations. However, importing bones which aren't connected to one another is less than ideal for most people, so I'm going to have to modify the exporter to add a PARENT keyword to the mesh data in order for me to be able to connect bones. I won't be making long bones, however, I'll be doing something similar to what the Source Engine importer does where bones are made into spheres at the rotation joint:

image

buu342 avatar May 10 '24 14:05 buu342

Amazing! Congrats on your masters degree, and welcome back :) . My modding tools are on hold themselves, but it's good to know this will be there when I get back to them!

naclomi avatar May 10 '24 16:05 naclomi

Finished as of 9122abc, tested working in 2.7 and onwards. As explained, due to the S64 format, bone parenting information is lost, as well as texture data (meaning you have to re-assign the images to the materials). Everything else should work as expected (UVs, vertex colors, animations, etc...).

buu342 avatar May 12 '24 16:05 buu342