thedamngod / Avorion-Obj-Converter

Convert models from the game "Avorion" into the Wavefront .obj format
MIT License
2 stars 0 forks source link

python Script? #7

Closed Asarjan closed 4 years ago

Asarjan commented 6 years ago

hi, ich kenne mich leider gar nicht mit python scripts aus. wie also benutze ich diesen converter für avorion schiffe die als xml-dateien gespeichert sind?

tretum commented 6 years ago

Hi, ich habe mal eine ganz einfache Beschreibung hinzugefügt. Ich hoffe, dass die dir schon einmal weiterhilft. Du solltest allerdings wissen, dass ich zuletzt in etwa im Februar an dem Tool gearbeitet habe und es eventuell nicht mehr mit der aktuellsten Version funktioniert. Wenn ich die Zeit finde werde ich in den nächsten Tagen mal gucken ob alles (zumindest soweit wie es früher ging) noch funktioniert.

Asarjan commented 6 years ago

sehr cool danke dir :) nja trotz das sich das game einer recht großen community erfreut, bist du der einzige der eine möglichkeit dafür liefert, schiffe aus dem game in 3d objekte umzuwandeln. und selbst wenn es nicht zu 100% funktioniert .. ich wär schon froh wenigstens die grobe form meiner schiffe in einem nutzbaren 3d-datei-format zu haben :)

tretum commented 6 years ago

Falls größere Probleme auftreten, dann poste am besten die Modelle als Gist mit dem link hier und ner Beschreibung was schief läuft. Ich werde es mir dann mal angucken.

Asarjan commented 6 years ago

ok danke :)

kurze frage noch ... bei der eingabe im cmd. muss ich da den kompletten pfad zu der AvObjConverter.py-datei eingeben oder muss die datei an nen bestimmten ort kopiert werden?

tretum commented 6 years ago

Um das ganze am einfachsten zu machen solltest du die cmd in dem Ordner aufmachen in dem die AvObjConverter.py liegt. Das geht einfach in dem du Shift+Rechtsklick im Ordner machst und dann "Hier Powershell öffnen" oder "Hier Kommandozeile öffnen" oder was ähnliches anklickst. Alternativ geht auch, zumindest unter Windows 10, über das Datei-Menü und dann mit dem zweiten Eintrag.

Asarjan commented 6 years ago

ok soweit hab ichs hin bekommen aber ich bekomme eine fehlermeldung:

Traceback (most recent call last): File "AvObjConverter.py", line 403, in converter.convertToObj(os.path.join(path, ship_name + '.xml'), './out/' + ship_name + '.obj') File "AvObjConverter.py", line 116, in convertToObj self.blocks = readSourceFile(inputFile) File "AvObjConverter.py", line 177, in readSourceFile blocks.append(Block(index, x_min, x_max, y_min, y_max, z_min, z_max, type, material, look, up, color)) File "AvObjConverter.py", line 42, in init self.x_max = float(x_max) TypeError: float() argument must be a string or a number, not 'NoneType'

Asarjan commented 6 years ago

btw der linke "Gist" weiter oben funktioniert nicht. da kommt nur ne weiße seite mit "Not Found"

tretum commented 6 years ago

Ok, sieht so aus als wäre da was kaputt im Script. Ich werde mir das bei Gelegenheit angucken. Der richtige Link ist Gist. Alternativ geht auch pastebin, oder ähnliches. Einfach den Inhalt der xml da reinkopieren oder wenn es geht einfach die Datei reinziehen.

Asarjan commented 6 years ago

das wäre super dankeschön :)

hier mal noch der code von dem schiff das ich als 3d-objekt haben wollen würde. https://gist.github.com/Asarjan/2784fb772d0a1f463afe2e7a099dd46f

tretum commented 6 years ago

Lad dir mal die neue Version runter und probier das ganze noch einmal. Es hatte sich etwas am Dateiformat geändert und das habe ich jetzt zumindest berichtigt. Aber wie gesagt ist das ganze nicht vollständig und auch im generierten Objekt sind die Blöcke nicht 1:1 auswählbar. Vielleicht kann ich das demnächst auch noch einmal korrigieren.

Asarjan commented 6 years ago

hi also ich habs jetzt mal getestet... er fängt an die blöcke zu konvertieren und am ende gibt er folgende meldung aus: Starting output on file ./out/C:\Users\asarj\Downloads\Kerbal Space Program Mods__own_mods\Avorion-Obj-Converter-master_new\AC-Tyr-MK-I.obj Traceback (most recent call last): File "AvObjConverter.py", line 406, in converter.convertToObj(os.path.join(path, ship_name + '.xml'), './out/' + ship_name + '.obj') File "AvObjConverter.py", line 124, in convertToObj writer.writeScene(self.scene) File "C:\Users\asarj\Downloads\Kerbal Space Program Mods__own_mods\Avorion-Obj-Converter-master_new\waveobjparser\ObjWriter.py", line 54, in writeScene with open(path, "w") as file: OSError: [Errno 22] Invalid argument: './out/C:\Users\asarj\Downloads\Kerbal Space Program Mods\__own_mods\Avorion-Obj-Converter-master_new\AC-Tyr-MK-I.obj'

tretum commented 6 years ago

Versuchst du einen anderen Ausgabepfad zu nutzen? Versuch einfach mal das ganze als python AvObjConverter.py "AC-Tyr-MK-I" auszuführen. Das sollte dann in einem Ordner mit dem Namen "out" im gleichen Verzeichnis wie AvObjConverter.py landen.

Asarjan commented 6 years ago

getestet .. "The input file was not found. Please make sure the file exists"

das gibt er dann aus .. die xml liegt im gleichen ordner wie das script

tretum commented 6 years ago

Wenn man keinen Pfad angibt, dann erwartet das Tool die Datei in dem Ordner wo sie vom Spiel abgelegt werden. Wenn du sie also wieder dahin verschiebst müsste es funktionieren. Ich werde es aber denke ich noch ein wenig anpassen, dass das ganze flexibler wird.

Asarjan commented 6 years ago

"Starting output on file ./out/AC-Tyr-MK-I.obj Traceback (most recent call last): File "AvObjConverter.py", line 406, in converter.convertToObj(os.path.join(path, ship_name + '.xml'), './out/' + ship_name + '.obj') File "AvObjConverter.py", line 124, in convertToObj writer.writeScene(self.scene) File "C:\Users\asarj\Downloads\Kerbal Space Program Mods__own_mods\Avorion-Obj-Converter-master_new\waveobjparser\ObjWriter.py", line 54, in writeScene with open(path, "w") as file: FileNotFoundError: [Errno 2] No such file or directory: './out/AC-Tyr-MK-I.obj'"

datei ist im ursprungsordner wo avorion die xml-dateien der schiffe speichert

im script in zeile 396 steht: path = os.path.join(os.getenv('APPDATA'), 'Avorion', 'ships') avorion speichert die xml-dateien bei mir unter C:\Users\Username\AppData\Roaming\Avorion\Ships\

könnte am pfad liegen?

tretum commented 6 years ago

Probier nochmal den Ordner "out" im Verzeichnis zu erstellen wo auch die AvObjConverter.py drin ist, falls der noch nicht existiert. Der Pfad ist korrekt. Wie gesagt, ich versuche mal insgesamt den Prozess zu verbessern :)

Asarjan commented 6 years ago

oh geil das hat funktioniert :D ich werd mir das gleich mal im 3d-programm anschauen :)

Asarjan commented 6 years ago

ok also da ging wohl wat schief .. ich hab im 3d-programm nur ein deformiertes objekt bei dem man denkt es besteht nur aus ner handvoll polygonen... aber es sind 640.000 polygone .. ich teste mal noch ein anderes weniger komplexes schiff

Asarjan commented 6 years ago

ok fehler gefunden .. ich muss es in 3ds max als "single mesh" importieren .. dann hauts auch hin :) super endlich kann ich meine avorion-kreationen für andere projekte verwenden :D super fettes danke an dich :)

joeturret commented 4 years ago

Hallo, ich habe versucht, dieses Programm zu verwenden, bin aber auf ein Problem gestoßen. Als ich den Namen meines Schiffes eingab, sagte die Konsole Folgendes: Name: CBS Arcturus Starting output on file ./out/CBS Arcturus.obj Conversion process took 0.0010104179382324219 seconds Converted 0 blocks

tretum commented 4 years ago

Hi, ich kann leider nicht garantieren, dass noch alles mit der aktuellen Version so funktioniert. Du könntest das Modell hochladen und ich versuche das dann bei Gelegenheit mal zu testen. Ich möchte aber keine Garantie geben, dass es funktionieren wird oder das ich das Tool noch aktualisieren werde. Sorry.


English: I can't guarantee you that the tool will work with models from the current game version. You could upload the model here and then I might be able to try it myself if I find the time. I cannot guarantee you as well that i will update the tool if that would be required. Sorry

joeturret commented 4 years ago

Nice, thank you for responding. I honestly had little hope that you would respond yet here you are. Here is the ship. CBS Arcturus.zip I thank you again.

joeturret commented 4 years ago

Hello, it has been 2 days and i am wondering if you are still here.

tretum commented 4 years ago

You are lucky that this was pretty easy to fix and I just started working on it. However, you should in general be more patient. I did tell you that I might not be able to fix it and that I can give you no guarantees. You can not expect everyone to just give up everything for a small project that was abandoned years ago.

Updated release

joeturret commented 4 years ago

I didn't mean to come off as rude, i was just curious on your progress. Sorry and thankyou.

tretum commented 4 years ago

Misunderstandings happen, it's ok :) Closing this issue. In case anything else comes up, please open a new one.