FBX export scene with multitake

Hello, blender users and coders

I wonder if there is a way to export complex animated scene from blender to .fbx file with multiple “takes”.
I know that blender .fbx exporter can grab actions from action editor and export it as “takes”.
The problem is that I need to export whole SCENE that has several character rigs as single fbx file where characters (rigs) follow the same animation track at once. Not same per each rig but for the whole scene.
There are 2 possible options with default fbx (binary) export script:

with “All Actions” or “NLA Strips” checked I get all animations from each rig, like: Char1.Idle, Char1.Dance, Char1.Idle, Char2.Dance and so on. So when I start animation only one character is moving.

with “All actions” or “NLA Strips” unchecked I get almost what I want: all characters start moving at once when I play animation, but the problem that I get only one “Scene” animation. And I see no way how to separate this long animation in parts and give it names as it possible for example in Unity:

I know that it is possible to store such “takes” split from one original animation in fbx file.
But I don’t know the way how to do it.
Unity can’t export back to .fbx. I am also not sure that my blender file can be successfully imported in other 3d software for further exporting to .fbx.
Does anybody know how to solve this problem with splitting animation of the complex scene in several “takes” and export it like that to .fbx file?

I found pieces of code in “export_fbx_bin.py” file that seems possible to solve my problem with a bit editing. But I am not very experienced in python and blender API especially, so I have failed in this task.


Are there anybody who is able to make corresponding adjustments to those lines of code?
Or anybody who can show me another solution for this task?

Any help would be greatly appreciated

I solved my problem. I can share my temporary solution.
I know it is very “unpythonic” and artificial.
First of all add list of animation takes at the top of “export_fbx_bin.py” in format [“name”, start_frame, end_frame]:

Takes=[['Take01',1,251], ['Take02',251,501], ['Take03',501,751]]

Then find function “fbx_animations_do” and replace following lines at the end

astack_key = get_blender_anim_stack_key(scene, ref_id)
    alayer_key = get_blender_anim_layer_key(scene, ref_id)
    name = (get_blenderID_name(ref_id) if ref_id else scene.name).encode()

with this

if ref_id:
        astack_key = get_blender_anim_stack_key(scene, ref_id)
        alayer_key = get_blender_anim_layer_key(scene, ref_id)
    else:
        astack_key = get_blenderID_key(scene) + "|" + Takes[fbx_animations_do.counter][0] + "|AnimStack"
        alayer_key = get_blenderID_key(scene) + "|" + Takes[fbx_animations_do.counter][0] + "|AnimLayer"
    name = (get_blenderID_name(ref_id) if ref_id else scene.name).encode()
    fbx_animations_do.counter+=1

after function:

fbx_animations_do.counter=0

now at “def fbx_animations(scene_data)” change following lines:

# Global (containing everything) animstack, only if not exporting NLA strips and/or all actions.
    if not scene_data.settings.bake_anim_use_nla_strips and not scene_data.settings.bake_anim_use_all_actions:
        add_anim(animations, animated, fbx_animations_do(scene_data, None, scene.frame_start, scene.frame_end, False))

with this:


    if not scene_data.settings.bake_anim_use_nla_strips and not scene_data.settings.bake_anim_use_all_actions:
        for take in Takes:
            add_anim(animations, animated, fbx_animations_do(scene_data, None, take[1], take[2], False))

I tried to save old functionality (export with “All actions” checked) but it seems to be broken.
Anyway you can export “default scene” animation split in several takes with this script, and restore original one for other purposes.
Or even better you can change script in correct way if you are more experienced in python and blender API than me )

I also find problem with original script that if you left “simplify” option on it can remove static animation take from final .fbx file.
I had one static animation 250 frames long (dont ask me why I need it, it is just eployer claim) and exporter seems to optimize it and throw it away.

Where is correct forum (if that one is not) to post those ‘bugs?’ and suggestions so developers could see it?