mirror of
https://github.com/godotengine/godot-tests.git
synced 2026-01-04 06:10:18 +03:00
Add for each blend.
This commit is contained in:
@@ -2,28 +2,33 @@
|
||||
import bpy
|
||||
import posixpath
|
||||
import shutil
|
||||
import os
|
||||
|
||||
blend = "32678-respect-import-hints-with-empty"
|
||||
bpy.ops.wm.open_mainfile(filepath="blend/" + blend + ".blend")
|
||||
directory = "blend"
|
||||
for filename in os.listdir(directory):
|
||||
if filename.endswith(".blend"):
|
||||
print(filename)
|
||||
bpy.ops.wm.open_mainfile(filepath="blend/" + filename)
|
||||
|
||||
strip_file_name = filename.rsplit(".blend", 1)[0]
|
||||
|
||||
export_type = "gltf"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=export_type + "/" + blend + ".gltf",
|
||||
export_format="GLTF_SEPARATE",
|
||||
export_copyright="The MIT License (MIT) Copyright (c) 2016 Godot Engine",
|
||||
)
|
||||
export_type = "gltf"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.gltf(
|
||||
filepath=export_type + "/" + strip_file_name + ".gltf",
|
||||
export_format="GLTF_SEPARATE",
|
||||
export_copyright="The MIT License (MIT) Copyright (c) 2016 Godot Engine",
|
||||
)
|
||||
|
||||
export_type = "obj"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.obj(filepath=export_type + "/" + strip_file_name + "." + export_type)
|
||||
|
||||
export_type = "obj"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.obj(filepath=export_type + "/" + blend + "." + export_type)
|
||||
|
||||
|
||||
export_type = "fbx"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.fbx(filepath=export_type + "/" + blend + "." + export_type)
|
||||
export_type = "fbx"
|
||||
shutil.rmtree(export_type, ignore_errors=True)
|
||||
posixpath.os.mkdir(export_type, mode=0o777)
|
||||
bpy.ops.export_scene.fbx(filepath=export_type + "/" + strip_file_name + "." + export_type)
|
||||
else:
|
||||
continue
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user