[Bf-extensions-cvs] [f8769f3] master: FBX IO Experimental: Get rid of 6.1 code

Bastien Montagne noreply at git.blender.org
Wed Sep 10 17:07:16 CEST 2014


Commit: f8769f35a5d6969f534bd4a9a97f81ef61fa337d
Author: Bastien Montagne
Date:   Wed Sep 10 17:05:53 2014 +0200
Branches: master
https://developer.blender.org/rBAf8769f35a5d6969f534bd4a9a97f81ef61fa337d

FBX IO Experimental: Get rid of 6.1 code

No need to keep it here, this won't be developed further, and remains available
in 'stable' version of the addon.

===================================================================

M	io_scene_fbx_experimental/__init__.py
D	io_scene_fbx_experimental/export_fbx.py

===================================================================

diff --git a/io_scene_fbx_experimental/__init__.py b/io_scene_fbx_experimental/__init__.py
index a273e21..de51ce1 100644
--- a/io_scene_fbx_experimental/__init__.py
+++ b/io_scene_fbx_experimental/__init__.py
@@ -227,14 +227,6 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
 
-    version = EnumProperty(
-            items=(('BIN7400', "FBX 7.4 binary", "Newer 7.4 binary version, still in development (no animation yet)"),
-                   ('ASCII6100', "FBX 6.1 ASCII", "Legacy 6.1 ascii version"),
-                   ),
-            name="Version",
-            description="Choose which version of the exporter to use",
-            )
-
     use_selection = BoolProperty(
             name="Selected Objects",
             description="Export selected objects on visible layers",
@@ -269,7 +261,6 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
                    ),
             default='Y',
             )
-    # 7.4 only
     bake_space_transform = BoolProperty(
             name="Apply Transform",
             description=("Bake space transform into object data, avoids getting unwanted rotations to objects when "
@@ -312,14 +303,12 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
             description="Export loose edges (as two-vertices polygons)",
             default=False,
             )
-    # 7.4 only
     use_tspace = BoolProperty(
             name="Tangent Space",
             description=("Add binormal and tangent vectors, together with normal they form the tangent space "
                          "(will only work correctly with tris/quads only meshes!)"),
             default=False,
             )
-    # 7.4 only
     use_custom_props = BoolProperty(
             name="Custom Properties",
             description="Export custom properties",
@@ -359,7 +348,7 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
             description="Only write deforming bones (and non-deforming ones when they have deforming children)",
             default=False,
             )
-    # Anim - 7.4
+    # Anim
     bake_anim = BoolProperty(
             name="Baked Animation",
             description="Export baked keyframe animation",
@@ -390,38 +379,7 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
             min=0.0, max=10.0,  # No simplification to up to 0.05 slope/100 max_frame_step.
             default=1.0,  # default: min slope: 0.005, max frame step: 10.
             )
-    # Anim - 6.1
-    use_anim = BoolProperty(
-            name="Animation",
-            description="Export keyframe animation",
-            default=True,
-            )
-    use_anim_action_all = BoolProperty(
-            name="All Actions",
-            description=("Export all actions for armatures or just the currently selected action"),
-            default=True,
-            )
-    use_default_take = BoolProperty(
-            name="Default Take",
-            description=("Export currently assigned object and armature animations into a default take from the scene "
-                         "start/end frames"),
-            default=True
-            )
-    use_anim_optimize = BoolProperty(
-            name="Optimize Keyframes",
-            description="Remove double keyframes",
-            default=True,
-            )
-    anim_optimize_precision = FloatProperty(
-            name="Precision",
-            description=("Tolerance for comparing double keyframes (higher for greater accuracy)"),
-            min=0.0, max=20.0,  # from 10^2 to 10^-18 frames precision.
-            soft_min=1.0, soft_max=16.0,
-            default=6.0,  # default: 10^-4 frames.
-            )
-    # End anim
     path_mode = path_reference_mode
-    # 7.4 only
     embed_textures = BoolProperty(
             name="Embed Textures",
             description="Embed textures in FBX binary file (only for \"Copy\" path mode!)",
@@ -447,15 +405,13 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
 
     def draw(self, context):
         layout = self.layout
-        is_74bin = (self.version == 'BIN7400')
 
         layout.prop(self, "version")
         layout.prop(self, "use_selection")
         layout.prop(self, "global_scale")
         layout.prop(self, "axis_forward")
         layout.prop(self, "axis_up")
-        if is_74bin:
-            layout.prop(self, "bake_space_transform")
+        layout.prop(self, "bake_space_transform")
 
         layout.separator()
         layout.prop(self, "object_types")
@@ -466,33 +422,23 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
         sub.enabled = self.mesh_smooth_type in {'OFF'}
         sub.prop(self, "use_tspace")
         layout.prop(self, "use_armature_deform_only")
-        if is_74bin:
-            layout.prop(self, "use_custom_props")
-            layout.prop(self, "add_leaf_bones")
-            layout.prop(self, "primary_bone_axis")
-            layout.prop(self, "secondary_bone_axis")
-            layout.prop(self, "bake_anim")
-            col = layout.column()
-            col.enabled = self.bake_anim
-            col.prop(self, "bake_anim_use_nla_strips")
-            col.prop(self, "bake_anim_use_all_actions")
-            col.prop(self, "bake_anim_step")
-            col.prop(self, "bake_anim_simplify_factor")
-        else:
-            layout.prop(self, "use_anim")
-            col = layout.column()
-            col.enabled = self.use_anim
-            col.prop(self, "use_anim_action_all")
-            col.prop(self, "use_default_take")
-            col.prop(self, "use_anim_optimize")
-            col.prop(self, "anim_optimize_precision")
+        layout.prop(self, "use_custom_props")
+        layout.prop(self, "add_leaf_bones")
+        layout.prop(self, "primary_bone_axis")
+        layout.prop(self, "secondary_bone_axis")
+        layout.prop(self, "bake_anim")
+        col = layout.column()
+        col.enabled = self.bake_anim
+        col.prop(self, "bake_anim_use_nla_strips")
+        col.prop(self, "bake_anim_use_all_actions")
+        col.prop(self, "bake_anim_step")
+        col.prop(self, "bake_anim_simplify_factor")
 
         layout.separator()
         layout.prop(self, "path_mode")
-        if is_74bin:
-            col = layout.column()
-            col.enabled = (self.path_mode == 'COPY')
-            col.prop(self, "embed_textures")
+        col = layout.column()
+        col.enabled = (self.path_mode == 'COPY')
+        col.prop(self, "embed_textures")
         layout.prop(self, "batch_mode")
         layout.prop(self, "use_batch_own_dir")
 
@@ -502,6 +448,7 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
 
     def execute(self, context):
         from mathutils import Matrix
+        from . import export_fbx_bin
         print("Using EXPERIMENTAL FBX import!")
         if not self.filepath:
             raise Exception("filepath not set")
@@ -518,12 +465,7 @@ class ExportFBX_experimental(bpy.types.Operator, ExportHelper):
 
         keywords["global_matrix"] = global_matrix
 
-        if self.version == 'BIN7400':
-            from . import export_fbx_bin
-            return export_fbx_bin.save(self, context, **keywords)
-        else:
-            from . import export_fbx
-            return export_fbx.save(self, context, **keywords)
+        return export_fbx_bin.save(self, context, **keywords)
 
 
 def menu_func_import(self, context):
diff --git a/io_scene_fbx_experimental/export_fbx.py b/io_scene_fbx_experimental/export_fbx.py
deleted file mode 100644
index ee98019..0000000
--- a/io_scene_fbx_experimental/export_fbx.py
+++ /dev/null
@@ -1,2931 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-# Script copyright (C) Campbell Barton
-
-
-import os
-import time
-import math  # math.pi
-
-import bpy
-from mathutils import Vector, Matrix
-
-def grouper_exact(it, chunk_size):
-    """
-    Grouper-like func, but returns exactly all elements from it:
-
-    >>> for chunk in grouper_exact(range(10), 3): print(e)
-    (0,1,2)
-    (3,4,5)
-    (6,7,8)
-    (9,)
-
-    About 2 times slower than simple zip(*[it] * 3), but does not need to convert iterator to sequence to be sure to
-    get exactly all elements in it (i.e. get a last chunk that may be smaller than chunk_size).
-    """
-    import itertools
-    i = itertools.zip_longest(*[iter(it)] * chunk_size, fillvalue=...)
-    curr = next(i)
-    for nxt in i:
-        yield curr
-        curr = nxt
-    if ... in curr:
-        yield curr[:curr.index(...)]
-    else:
-        yield curr
-
-# I guess FBX uses degrees instead of radians (Arystan).
-# Call this function just before writing to FBX.
-# 180 / math.pi == 57.295779513
-def tuple_rad_to_deg(eul):
-    return eul[0] * 57.295779513, eul[1] * 57.295779513, eul[2] * 57.295779513
-
-# Used to add the scene name into the filepath without using odd chars
-sane_name_mapping_ob = {}
-sane_name_mapping_ob_unique = set()
-sane_name_mapping_mat = {}
-sane_name_mapping_tex = {}
-sane_name_mapping_take = {}
-sane_name_mapping_group = {}
-
-# Make sure reserved names are not used
-sane_name_mapping_ob['Scene'] = 'Scene_'
-sane_name_mapping_ob_unique.add('Scene_')
-
-
-def increment_string(t):
-    name = t
-    num = ''
-    while name and name[-1].i

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list