Created
November 20, 2023 14:43
-
-
Save Pankraz01/b8ef348cd12d10ca00d0a4af7df4de86 to your computer and use it in GitHub Desktop.
Pyhton Script: OBJ to FBX Converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.threed as a3d | |
import tkinter as tk | |
from tkinter import filedialog | |
def select_files_and_convert(): | |
root = tk.Tk() | |
root.withdraw() # Versteckt das Hauptfenster von Tkinter | |
# Öffnen des Dateiauswahldialogs für die Eingabedatei | |
input_file_path = filedialog.askopenfilename(title="Wählen Sie die zu konvertierende OBJ-Datei aus", filetypes=[("OBJ files", "*.obj")]) | |
if not input_file_path: | |
print("Keine Eingabedatei ausgewählt.") | |
return | |
# Öffnen des Dateiauswahldialogs für die Ausgabedatei | |
output_file_path = filedialog.asksaveasfilename(title="Speichern Sie die konvertierte FBX-Datei", defaultextension=".fbx", filetypes=[("FBX files", "*.fbx")]) | |
if not output_file_path: | |
print("Kein Ausgabepfad ausgewählt.") | |
return | |
# Laden und Konvertieren der ausgewählten Datei | |
scene = a3d.Scene.from_file(input_file_path) | |
scene.save(output_file_path) | |
print(f"Datei konvertiert und gespeichert als: {output_file_path}") | |
select_files_and_convert() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment