Seite 8 von 8
Gehe zu Seite Vorherige  1 ... 4, 5, 6, 7, 8
Autor
Nachricht
Ein neues Thema erstellen  Auf das Thema antworten
 Offline

:: Ensign ::

 Profil  
Mit Zitat antworten  
Beitrag #13241 Verfasst: Sonntag 22. November 2020, 18:59
Benutzeravatar

Beiträge: 9
Registriert: Freitag 25. November 2011, 14:24
Wohnort: Lyon, France
Re: Schleichfahrt Dateiformat
Licht !

Sorry not to speak German but I've almost forgot everythig now :twist:

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.


Dateianhänge:
ships.png
ships.png [ 1.23 MiB | 94-mal betrachtet ]
 Offline

:: Lt. Commander ::

 Profil  
Mit Zitat antworten  
Beitrag #13242 Verfasst: Montag 23. November 2020, 20:33

Beiträge: 210
Registriert: Montag 7. Juni 2010, 17:54
Re: Schleichfahrt Dateiformat
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.

__________________
http://sourceforge.net/projects/schleic ... /p3d-file/ <-Schleichfahrt remake. Für die p3d Datei wird http://www.panda3d.org/download.php?runtime benötigt.


 Offline

:: Ensign ::

 Profil  
Mit Zitat antworten  
Beitrag #13243 Verfasst: Montag 23. November 2020, 21:10
Benutzeravatar

Beiträge: 9
Registriert: Freitag 25. November 2011, 14:24
Wohnort: Lyon, France
Re: Schleichfahrt Dateiformat
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 :D

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


 Offline

:: Lt. Commander ::

 Profil  
Mit Zitat antworten  
Beitrag #13244 Verfasst: Montag 23. November 2020, 22:02

Beiträge: 210
Registriert: Montag 7. Juni 2010, 17:54
Re: Schleichfahrt Dateiformat
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:
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:
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.

__________________
http://sourceforge.net/projects/schleic ... /p3d-file/ <-Schleichfahrt remake. Für die p3d Datei wird http://www.panda3d.org/download.php?runtime benötigt.


 Offline

:: Ensign ::

 Profil  
Mit Zitat antworten  
Beitrag #13245 Verfasst: Montag 23. November 2020, 22:46
Benutzeravatar

Beiträge: 9
Registriert: Freitag 25. November 2011, 14:24
Wohnort: Lyon, France
Re: Schleichfahrt Dateiformat
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.


Alle Zeiten sind UTC + 1 Stunde . Aktuelle Zeit: Montag 30. November 2020, 06:27.

Ein neues Thema erstellen  Auf das Thema antworten
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
 Seite 8 von 8
Gehe zu Seite Vorherige  1 ... 4, 5, 6, 7, 8

Druckansicht



Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de Impressum