[Bf-extensions-cvs] [6fccd8c] master: FBX Import: fix scale handling to match again our exporter's one.

Bastien Montagne noreply at git.blender.org
Fri May 22 22:25:42 CEST 2015


Commit: 6fccd8c57cca34ab2a78f5e86f963b7569993515
Author: Bastien Montagne
Date:   Fri May 22 22:23:10 2015 +0200
Branches: master
https://developer.blender.org/rBA6fccd8c57cca34ab2a78f5e86f963b7569993515

FBX Import: fix scale handling to match again our exporter's one.

Still unsure we are doing the 'right' thing here, but at least let's be consistent
between our importer and exporter!

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

M	io_scene_fbx/__init__.py
M	io_scene_fbx/import_fbx.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 1d613b4..c9931ce 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, 3, 1),
+    "version": (3, 3, 2),
     "blender": (2, 74, 0),
     "location": "File > Import-Export",
     "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 33950f4..4218a4e 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -2150,7 +2150,9 @@ def load(operator, context, filepath="",
         return {'CANCELLED'}
 
     # FBX default base unit seems to be the centimeter, while raw Blender Unit is equivalent to the meter...
-    global_scale *= elem_props_get_number(fbx_settings_props, b'UnitScaleFactor', 100.0) / 100.0
+    unit_scale = elem_props_get_number(fbx_settings_props, b'UnitScaleFactor', 1.0)
+    unit_scale_org = elem_props_get_number(fbx_settings_props, b'OriginalUnitScaleFactor', 1.0)
+    global_scale *=  unit_scale / unit_scale_org / 100.0
     # Compute global matrix and scale.
     if not use_manual_orientation:
         axis_forward = (elem_props_get_integer(fbx_settings_props, b'FrontAxis', 1),



More information about the Bf-extensions-cvs mailing list