Skip to content

Instantly share code, notes, and snippets.

@selfsame
Last active March 2, 2016 15:45
Show Gist options
  • Select an option

  • Save selfsame/3c64cecd4c7e606b2fb7 to your computer and use it in GitHub Desktop.

Select an option

Save selfsame/3c64cecd4c7e606b2fb7 to your computer and use it in GitHub Desktop.
fbx_dump.py
import bpy, os
from random import randint
file = bpy.data.filepath.split("\\")[-1:][0]
print("#"+file)
dump_path = "C:\\dump\\"+file+"\\"
os.makedirs(dump_path)
for s in bpy.data.scenes:
print(" - scene: ", s.name)
for o in s.objects:
o.select = False
for o in s.objects:
print(" - object: ", o.name)
o.select = True
bpy.ops.export_scene.fbx(filepath=dump_path+ o.name + ".fbx", use_selection=True, use_metadata=False, apply_unit_scale=True, axis_forward="Y", axis_up="Z",version="ASCII6100", object_types={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', 'OTHER'}, use_anim_optimize=True, )
o.select = False
print("#FINE\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment