不是用这个,这个是一行一行的
要使用这个,文本编辑器
代码照抄 https://blog.csdn.net/weixin_38527697/article/details/117441532 其中要注意文件夹路径,并且创建临时文件夹
import sys
import bpy
import os
path="D:\\Documents\\Assest\\Mesh\\VNB Low Poly Office Set 2\\Zip\\FBX\\Separated FBX files"
for i,j,k in os.walk(path):
for a in k:
if a.endswith(".fbx"):
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
currentpsth=path+"\\"+a
bpy.ops.import_scene.fbx(filepath=currentpsth)
fname,ext = os.path.splitext(a)
outpath="D:\\Documents\\Assest\\Mesh\\VNB Low Poly Office Set 2\\Zip\\FBX\\Separated FBX files\\Cache"+fname+".gltf"
bpy.ops.export_scene.gltf(filepath=outpath)
复制粘贴之后执行,搞定
|