Created
August 29, 2017 17:57
-
-
Save cyaoeu/8ca94319a23d5d3233c5c1792cb8ad99 to your computer and use it in GitHub Desktop.
Blender script: batch export anims
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
path = bpy.path.abspath('//') #path of .blend | |
objname = bpy.context.active_object.name #select rig | |
singleanim = True | |
if singleanim == True: | |
action = bpy.context.active_object.animation_data.action | |
bpy.ops.screen.frame_jump() | |
bpy.data.scenes[0].frame_end = action.frame_range[1] | |
bpy.ops.export_scene.fbx(filepath=str(path + "/animations/" + "AS_" + action.name + '.fbx'), use_selection = True, object_types={'ARMATURE'}, bake_anim = True, bake_anim_use_nla_strips=False, bake_anim_use_all_actions=False , add_leaf_bones=False, bake_anim_use_all_bones=True, use_armature_deform_only = True) | |
#batchanims | |
if singleanim == False: | |
for action in bpy.data.actions: | |
bpy.context.active_object.animation_data.action = action | |
bpy.data.scenes[0].frame_end = action.frame_range[1] | |
bpy.ops.export_scene.fbx(filepath=str(path + "/animations/" + "AS_" + action.name + '.fbx'), use_selection = True, object_types={'ARMATURE'}, bake_anim = True, bake_anim_use_nla_strips=False, bake_anim_use_all_actions=False , add_leaf_bones=False, bake_anim_use_all_bones=True, use_armature_deform_only = True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment