[Bf-extensions-cvs] [afeee19] master: Fix T50045: FBX Export Scale (global_scale) is applied twice.

Bastien Montagne noreply at git.blender.org
Fri Nov 18 14:16:17 CET 2016

Commit: afeee1999be96e7a5eb5f35dca9f326d1646eeb4
Author: Bastien Montagne
Date:   Fri Nov 18 14:14:45 2016 +0100
Branches: master

Fix T50045: FBX Export Scale (global_scale) is applied twice.

Do not store export scaling, this is internal runtime data specific to
exporter, it’s applied already in objetcs' matrices, and has nothing to
do with actual FBX global scaling.


M	io_scene_fbx/export_fbx_bin.py


diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 49e8e16..36e8ea1 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -2672,13 +2672,15 @@ def fbx_header_elements(root, scene_data, time=None):
     props = elem_properties(global_settings)
     up_axis, front_axis, coord_axis = RIGHT_HAND_AXES[scene_data.settings.to_axes]
+    # DO NOT take into account global scale here! That setting is applied to object transformations during export
+    # (in other words, this is pure blender-exporter feature, and has nothing to do with FBX data).
     if scene_data.settings.apply_unit_scale:
         # Unit scaling is applied to objects' scale, so our unit is effectively FBX one (centimeter).
         scale_factor_org = 1.0
-        scale_factor = scene_data.settings.global_scale / units_blender_to_fbx_factor(scene)
+        scale_factor = 1.0 / units_blender_to_fbx_factor(scene)
         scale_factor_org = units_blender_to_fbx_factor(scene)
-        scale_factor = scene_data.settings.global_scale * units_blender_to_fbx_factor(scene)
+        scale_factor = scale_factor_org
     elem_props_set(props, "p_integer", b"UpAxis", up_axis[0])
     elem_props_set(props, "p_integer", b"UpAxisSign", up_axis[1])
     elem_props_set(props, "p_integer", b"FrontAxis", front_axis[0])

More information about the Bf-extensions-cvs mailing list