[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2219] trunk/py/scripts/addons/ io_scene_fbx/export_fbx.py: - fix for error in new option disabling default take

Campbell Barton ideasman42 at gmail.com
Thu Aug 4 07:49:39 CEST 2011


Revision: 2219
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2219
Author:   campbellbarton
Date:     2011-08-04 05:49:39 +0000 (Thu, 04 Aug 2011)
Log Message:
-----------
- fix for error in new option disabling default take
- added default options for unity3d, can add other defaults too

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_fbx/export_fbx.py

Modified: trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2011-08-03 11:03:04 UTC (rev 2218)
+++ trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2011-08-04 05:49:39 UTC (rev 2219)
@@ -204,7 +204,7 @@
         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 @@
                 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 @@
     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')



More information about the Bf-extensions-cvs mailing list