Skip to content

Instantly share code, notes, and snippets.

@cyaoeu
Created September 27, 2017 13:10
Show Gist options
  • Save cyaoeu/ad08f9feccb1c37ded3145778b75c4b8 to your computer and use it in GitHub Desktop.
Save cyaoeu/ad08f9feccb1c37ded3145778b75c4b8 to your computer and use it in GitHub Desktop.
Import multiple FBX files (hacky)
import bpy
import os
def listFiles(dir, ext):
fileList = []
for file in os.listdir(path):
if file[-len(ext):] == ext:
fileList.append(file)
return fileList
path = bpy.path.abspath('//') #.blend path by default
files = []
files = listFiles(dir = path, ext = '.fbx')
for file in files:
bpy.ops.import_scene.fbx(filepath=path+file, axis_forward='-Z', axis_up='Y', directory="", filter_glob="*.fbx", ui_tab='MAIN', use_manual_orientation=False, global_scale=1, bake_space_transform=False, use_custom_normals=True, use_image_search=True, use_alpha_decals=False, decal_offset=0, use_anim=True, anim_offset=1, use_custom_props=True, use_custom_props_enum_as_string=True, ignore_leaf_bones=False, force_connect_children=False, automatic_bone_orientation=False, primary_bone_axis='Y', secondary_bone_axis='X', use_prepost_rot=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment