Advertisement
Graphicianz

Untitled

Jan 23rd, 2022
1,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import bpy
  2. import os
  3.  
  4. fbxPath = r'Q:\testfbx'
  5.  
  6. fbxList = os.listdir(fbxPath)
  7. for fbx in fbxList:
  8.     filename = fbx[:-4]
  9.     fbxObj = bpy.ops.import_scene.fbx( filepath = fbxPath+'\\'+fbx )
  10.    
  11.     objs = bpy.context.selected_objects
  12.     name = ", ".join(o.name for o in objs)
  13.     bpy.data.objects[name].select_set(True)
  14.    
  15.     bpy.ops.export_scene.gltf( filepath = fbxPath+'\\'+filename+'.glb', export_selected=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement