Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_fbx/__init__.py')
-rw-r--r--io_scene_fbx/__init__.py170
1 files changed, 44 insertions, 126 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 11668fee..fddeda6c 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
- "version": (3, 9, 3),
+ "version": (3, 10, 0),
"blender": (2, 79, 1),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
@@ -246,16 +246,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
# 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", "Modern 7.4 binary version"),
- ('ASCII6100', "FBX 6.1 ASCII",
- "Legacy 6.1 ascii version - WARNING: Deprecated and no more maintained"),
- ),
- name="Version",
- description="Choose which version of the exporter to use",
- )
-
- # 7.4 only
ui_tab = EnumProperty(
items=(('MAIN', "Main", "Main basic settings"),
('GEOMETRY', "Geometries", "Geometry-related settings"),
@@ -278,13 +268,11 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
soft_min=0.01, soft_max=1000.0,
default=1.0,
)
- # 7.4 only
apply_unit_scale = BoolProperty(
name="Apply Unit",
description="Take into account current Blender units settings (if unset, raw Blender Units values are used as-is)",
default=True,
)
- # 7.4 only
apply_scale_options = EnumProperty(
items=(('FBX_SCALE_NONE', "All Local",
"Apply custom scaling and units scaling to each object transformation, FBX scale remains at 1.0"),
@@ -300,7 +288,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
"(Blender uses FBX scale to detect units on import, "
"but many other applications do not handle the same way)",
)
- # 7.4 only
bake_space_transform = BoolProperty(
name="!EXPERIMENTAL! Apply Transform",
description="Bake space transform into object data, avoids getting unwanted rotations to objects when "
@@ -349,14 +336,12 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
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",
@@ -406,7 +391,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
"perfectly in Blender...)",
default='NULL',
)
- # Anim - 7.4
bake_anim = BoolProperty(
name="Baked Animation",
description="Export baked keyframe animation",
@@ -450,38 +434,7 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
soft_min=0.0, soft_max=10.0,
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!)",
@@ -508,92 +461,61 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
def draw(self, context):
layout = self.layout
- layout.prop(self, "version")
-
- if self.version == 'BIN7400':
- layout.prop(self, "ui_tab", expand=True)
- if self.ui_tab == 'MAIN':
- layout.prop(self, "use_selection")
-
- col = layout.column(align=True)
- row = col.row(align=True)
- row.prop(self, "global_scale")
- sub = row.row(align=True)
- sub.prop(self, "apply_unit_scale", text="", icon='NDOF_TRANS')
- col.prop(self, "apply_scale_options")
-
- layout.prop(self, "axis_forward")
- layout.prop(self, "axis_up")
-
- layout.separator()
- layout.prop(self, "object_types")
- layout.prop(self, "bake_space_transform")
- layout.prop(self, "use_custom_props")
-
- layout.separator()
- row = layout.row(align=True)
- row.prop(self, "path_mode")
- sub = row.row(align=True)
- sub.enabled = (self.path_mode == 'COPY')
- sub.prop(self, "embed_textures", text="", icon='PACKAGE' if self.embed_textures else 'UGLYPACKAGE')
- row = layout.row(align=True)
- row.prop(self, "batch_mode")
- sub = row.row(align=True)
- sub.prop(self, "use_batch_own_dir", text="", icon='NEWFOLDER')
- elif self.ui_tab == 'GEOMETRY':
- layout.prop(self, "use_mesh_modifiers")
- sub = layout.row()
- sub.enabled = self.use_mesh_modifiers
- sub.prop(self, "use_mesh_modifiers_render")
- layout.prop(self, "mesh_smooth_type")
- layout.prop(self, "use_mesh_edges")
- sub = layout.row()
- #~ sub.enabled = self.mesh_smooth_type in {'OFF'}
- sub.prop(self, "use_tspace")
- elif self.ui_tab == 'ARMATURE':
- layout.prop(self, "use_armature_deform_only")
- layout.prop(self, "add_leaf_bones")
- layout.prop(self, "primary_bone_axis")
- layout.prop(self, "secondary_bone_axis")
- layout.prop(self, "armature_nodetype")
- elif self.ui_tab == 'ANIMATION':
- layout.prop(self, "bake_anim")
- col = layout.column()
- col.enabled = self.bake_anim
- col.prop(self, "bake_anim_use_all_bones")
- col.prop(self, "bake_anim_use_nla_strips")
- col.prop(self, "bake_anim_use_all_actions")
- col.prop(self, "bake_anim_force_startend_keying")
- col.prop(self, "bake_anim_step")
- col.prop(self, "bake_anim_simplify_factor")
- else:
+ layout.prop(self, "ui_tab", expand=True)
+ if self.ui_tab == 'MAIN':
layout.prop(self, "use_selection")
- layout.prop(self, "global_scale")
+
+ col = layout.column(align=True)
+ row = col.row(align=True)
+ row.prop(self, "global_scale")
+ sub = row.row(align=True)
+ sub.prop(self, "apply_unit_scale", text="", icon='NDOF_TRANS')
+ col.prop(self, "apply_scale_options")
+
layout.prop(self, "axis_forward")
layout.prop(self, "axis_up")
layout.separator()
layout.prop(self, "object_types")
+ layout.prop(self, "bake_space_transform")
+ layout.prop(self, "use_custom_props")
+
+ layout.separator()
+ row = layout.row(align=True)
+ row.prop(self, "path_mode")
+ sub = row.row(align=True)
+ sub.enabled = (self.path_mode == 'COPY')
+ sub.prop(self, "embed_textures", text="", icon='PACKAGE' if self.embed_textures else 'UGLYPACKAGE')
+ row = layout.row(align=True)
+ row.prop(self, "batch_mode")
+ sub = row.row(align=True)
+ sub.prop(self, "use_batch_own_dir", text="", icon='NEWFOLDER')
+ elif self.ui_tab == 'GEOMETRY':
layout.prop(self, "use_mesh_modifiers")
+ sub = layout.row()
+ sub.enabled = self.use_mesh_modifiers
+ sub.prop(self, "use_mesh_modifiers_render")
layout.prop(self, "mesh_smooth_type")
layout.prop(self, "use_mesh_edges")
sub = layout.row()
#~ sub.enabled = self.mesh_smooth_type in {'OFF'}
sub.prop(self, "use_tspace")
+ elif self.ui_tab == 'ARMATURE':
layout.prop(self, "use_armature_deform_only")
- layout.prop(self, "use_anim")
+ layout.prop(self, "add_leaf_bones")
+ layout.prop(self, "primary_bone_axis")
+ layout.prop(self, "secondary_bone_axis")
+ layout.prop(self, "armature_nodetype")
+ elif self.ui_tab == 'ANIMATION':
+ layout.prop(self, "bake_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.separator()
- layout.prop(self, "path_mode")
-
- layout.prop(self, "batch_mode")
- layout.prop(self, "use_batch_own_dir")
+ col.enabled = self.bake_anim
+ col.prop(self, "bake_anim_use_all_bones")
+ col.prop(self, "bake_anim_use_nla_strips")
+ col.prop(self, "bake_anim_use_all_actions")
+ col.prop(self, "bake_anim_force_startend_keying")
+ col.prop(self, "bake_anim_step")
+ col.prop(self, "bake_anim_simplify_factor")
@property
def check_extension(self):
@@ -615,12 +537,8 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
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)
+ from . import export_fbx_bin
+ return export_fbx_bin.save(self, context, **keywords)
def menu_func_import(self, context):