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__.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 3b6ca352..039e7952 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, 7, 10),
+ "version": (3, 7, 11),
"blender": (2, 77, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
@@ -281,11 +281,26 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
# 7.4 only
apply_unit_scale = BoolProperty(
name="Apply Unit",
- description="Scale all data according to current Blender size, to match default FBX unit "
- "(centimeter, some importers do not handle UnitScaleFactor properly)",
+ 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"),
+ ('FBX_SCALE_UNITS', "FBX Units Scale",
+ "Apply custom scaling to each object transformation, and units scaling to FBX scale"),
+ ('FBX_SCALE_CUSTOM', "FBX Custom Scale",
+ "Apply custom scaling to FBX scale, and units scaling to each object transformation"),
+ ('FBX_SCALE_ALL', "FBX All",
+ "Apply custom scaling and units scaling to FBX scale"),
+ ),
+ name="Apply Scalings",
+ description="How to apply custom and units scalings in generated FBX file "
+ "(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 "
@@ -499,10 +514,14 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
layout.prop(self, "ui_tab", expand=True)
if self.ui_tab == 'MAIN':
layout.prop(self, "use_selection")
- row = layout.row(align=True)
+
+ 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")
@@ -585,13 +604,11 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
if not self.filepath:
raise Exception("filepath not set")
- global_matrix = (Matrix.Scale(self.global_scale, 4) *
- axis_conversion(to_forward=self.axis_forward,
+ global_matrix = (axis_conversion(to_forward=self.axis_forward,
to_up=self.axis_up,
).to_4x4())
- keywords = self.as_keywords(ignore=("global_scale",
- "check_existing",
+ keywords = self.as_keywords(ignore=("check_existing",
"filter_glob",
"ui_tab",
))