Skip to content

Instantly share code, notes, and snippets.

import bpy
from math import pi, floor
rig = bpy.context.selected_objects[0]
def is_keyframe(ob, frame, data_path, array_index=-1):
if ob is not None and ob.animation_data is not None and ob.animation_data.action is not None:
for fcu in ob.animation_data.action.fcurves:
if fcu.data_path == data_path:
if array_index == -1 or fcu.array_index == array_index:
import bpy
bpy.ops.object.mode_set(mode='POSE', toggle=False)
bpy.ops.pose.select_all(action="SELECT")
selbones = bpy.context.selected_pose_bones
targetrig = bpy.data.objects["root"]
ignore = ("CS_thigh","CS_calf", "CS_upperarm","CS_lowerarm","CS_LegPoletarget","CS_ElboRoll","CS_foot_l","CS_foot_r","CS_FootRoolMain","CS_hand_l","CS_hand_r","CS_thumb_all","CS_middle_All","CS_index_all","CS_pinky_All","CS_ring_All")
@cyaoeu
cyaoeu / fbx_batchexport_anims.py
Created August 29, 2017 17:57
Blender script: batch export anims
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