diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py index e3cc0e37c5f1f3b14b7fa98d4b6b97fc1e81720c..67422691bc659dd138c4a6a7c701e41cebc403a2 100644 --- a/io_scene_fbx/export_fbx.py +++ b/io_scene_fbx/export_fbx.py @@ -204,7 +204,7 @@ def save_single(operator, scene, filepath="", path_mode='AUTO', use_mesh_edges=True, use_rotate_workaround=False, - use_default_take=False, + use_default_take=True, ): import bpy_extras.io_utils @@ -2560,9 +2560,8 @@ Takes: {''') act_end = end else: # use existing name - if blenAction == blenActionDefault: # have we already got the name - take_name = sane_name_mapping_take[blenAction.name] - else: + take_name = sane_name_mapping_take.get(blenAction.name) + if take_name is None: take_name = sane_takename(blenAction) act_start, act_end = blenAction.frame_range @@ -2832,13 +2831,27 @@ Takes: {''') return {'FINISHED'} +# defaults for applications, currently only unity but could add others. +def defaults_unity3d(): + return dict(global_matrix=Matrix.Rotation(-math.pi / 2.0, 4, 'X'), + use_selection=False, + object_types={'ARMATURE', 'EMPTY', 'MESH'}, + use_mesh_modifiers=True, + use_anim=True, + use_anim_optimize=False, + use_anim_action_all=True, + batch_mode='OFF', + use_default_take=True, + ) + + def save(operator, context, - filepath="", - use_selection=True, - batch_mode='OFF', - use_batch_own_dir=False, - **kwargs - ): + filepath="", + use_selection=False, + batch_mode='OFF', + use_batch_own_dir=False, + **kwargs + ): if bpy.ops.object.mode_set.poll(): bpy.ops.object.mode_set(mode='OBJECT')