Seite 8 von 8
Re: Schleichfahrt Dateiformat
Verfasst: Sonntag 22. November 2020, 18:59
von Kickthebaby
Licht !
Sorry not to speak German but I've almost forgot everythig now
This weekend I wanted as a little side project to make a converter using SF-Reloaded source to convert SF files to more common files
You can find it there:
https://github.com/LMCrashy/SF-Converter
There is also a binary release here :
https://github.com/LMCrashy/SF-Converte ... es/tag/0.1
The repository readme says everything.
Here is a small pic of some ships in blender
The size is kinda normalized using the .MOD embedded scale, but I'm not really sure how to handle these values.
Re: Schleichfahrt Dateiformat
Verfasst: Montag 23. November 2020, 20:33
von Nox_firegalaxy
Hey there. Nice work! If you are interested about the handling of the scaling factors some digging into the python code should yield somethine. Tbh it is so many years away, that I cannot recall any details. Only that one kind of model needed some extra rescaling which really bugged me.
Re: Schleichfahrt Dateiformat
Verfasst: Montag 23. November 2020, 21:10
von Kickthebaby
Yeah, I've seen that there is a scale param in the DES files too, yet I'm not sure if one does need to apply the mesh scale somehow before applying the .DES scale, or only the latter, and reading python gives me headaches
However I'm not sure what I'm going to do with these assets, I'm already very busy on my professional project. I've starded writing a vulkan toy engine as a side project and wanted to use some of the models as tests. Would be nice to render stuff from the 3D fx era with Vulkan ahah
Re: Schleichfahrt Dateiformat
Verfasst: Montag 23. November 2020, 22:02
von Nox_firegalaxy
https://sourceforge.net/p/schleichfahrt ... ts.py#l688 (parseCluster)
and
https://sourceforge.net/p/schleichfahrt ... ter.py#l77 (importModel)
So it is a combination of "Scale" in the "Size" section from the "VFX/SOBJECTS/" .DES file for the dtype (game object) and the input regarding scale .DES file from the "gamedata/NEWMODULE/" folder. So I think my code complete ignores the mesh scale. The python code was my very first big project with python back then and the version is rather acient by now. So this is not really an example for good python by any means. However, python is very good for rapid prototyping.
E.G. the MVI to PNG part can be written in python as:
Code: Alles auswählen
from PIL import Image
import SF_Loader
path_to_your_SF_files = "D:/SF"
name = "FILM/D02"
counter = 0
mvi_file = SF_Loader.MVILoader()
mvi_file.load(path_to_your_SF_files + "/GFX/MVI/" + name)
while not mvi_file.has_finished():
mvi_file.decode_next_frame()
img = Image.frombuffer("RGBA", (mvi_file.width, mvi_file.height), mvifile.imgdata)
img.save(f"frame{counter:03d}.png","png")
counter += 1
And actually this is only because I wrote the exporter poorly. If I would have done it properly it would be:
Code: Alles auswählen
from PIL import Image
import SF_Loader
path_to_your_SF_files = "D:/SF"
name = "FILM/D02"
counter = 0
mvi_file = SF_Loader.MVILoader()
mvi_file.load(path_to_your_SF_files + "/GFX/MVI/" + name)
for frame_number, frame in enumerate(mvi_file):
img = Image.frombuffer("RGBA", (frame.width, frame.height), frame.imgdata)
img.save(f"frame{frame_number:03d}.png","png")
So one can write very meaningful code with minimal "noise" (i.e. code which does not add information). So I can only recommend to take a closer look and give python a try. It is really worth it. Especially if your time is the limiting resource.
Re: Schleichfahrt Dateiformat
Verfasst: Montag 23. November 2020, 22:46
von Kickthebaby
Thank you for the insight. Your code is indeed very clear and easily understandable, it was a great help, I'm just not very used to Python, although I plan to learn more of it because I need to write some blender tools in the near future.
Re: Schleichfahrt Dateiformat
Verfasst: Dienstag 3. Januar 2023, 02:26
von Crimzan
Kickthebaby hat geschrieben:This weekend I wanted as a little side project to make a converter using SF-Reloaded source to convert SF files to more common files
Hello!
This is awesome! Thanks so much for making this tool!
I have a question / Problem though, I set up the file paths like in your example.bat (of course with corrected paths), but it doesn't convert any files. It recreates the folder structure, but then it instantly closes and doesn't convert any file. Am I missing something?
Also, any chance room Animation videos are coming any time soon? Those are what I personally look forward to the most
Found multiple scripts, tried dabbling with Python but I am no programmer and I just have trouble everywhere with that haha :P
Anyways, Happy New Year and thank you for your effort!
Re: Schleichfahrt Dateiformat
Verfasst: Mittwoch 13. September 2023, 23:30
von sirleto
if you have questions about the original format, why not contact the original author
https://www.xing.com/profile/Ingo_Frick