[Bf-extensions-cvs] [80cfaec] master: Fix T49412: We do not support FBX 7500 and above, at least properly report it to users.

Bastien Montagne noreply at git.blender.org
Thu Sep 22 17:02:29 CEST 2016


Commit: 80cfaeca0954b51d950a5cb27312768a7a99af50
Author: Bastien Montagne
Date:   Thu Sep 22 16:55:38 2016 +0200
Branches: master
https://developer.blender.org/rBA80cfaeca0954b51d950a5cb27312768a7a99af50

Fix T49412: We do not support FBX 7500 and above, at least properly report it to users.

Those ... people? at AD changed the whole format on binary level it'd seem, even low-level,
binary parsing is broken with those files, nothing else to do but go back to
binary hacking/inspection of new files if we want to support them... will let that
to someone else, FBX has successfully exhausted my patience since years already,
even all the backup emergency reserves I had.

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

M	io_scene_fbx/__init__.py
M	io_scene_fbx/fbx2json.py
M	io_scene_fbx/import_fbx.py
M	io_scene_fbx/parse_fbx.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index e9180ea..661955b 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, 6),
+    "version": (3, 7, 7),
     "blender": (2, 77, 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/fbx2json.py b/io_scene_fbx/fbx2json.py
index 68ceb5b..21b0fcc 100755
--- a/io_scene_fbx/fbx2json.py
+++ b/io_scene_fbx/fbx2json.py
@@ -198,6 +198,8 @@ def parse(fn, use_namedtuple=True):
             raise IOError("Invalid header")
 
         fbx_version = read_uint(read)
+        if fbx_version >= 7500:
+            raise IOError("Unsupported FBX version (%d), binary format is incompatible!" % fbx_version)
 
         while True:
             elem = read_elem(read, tell, use_namedtuple)
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 75a8db6..46cef68 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -2250,11 +2250,11 @@ def load(operator, context, filepath="",
 
     try:
         elem_root, version = parse_fbx.parse(filepath)
-    except:
+    except Exception as e:
         import traceback
         traceback.print_exc()
 
-        operator.report({'ERROR'}, "Couldn't open file %r" % filepath)
+        operator.report({'ERROR'}, "Couldn't open file %r (%s)" % (filepath, e))
         return {'CANCELLED'}
 
     if version < 7100:
diff --git a/io_scene_fbx/parse_fbx.py b/io_scene_fbx/parse_fbx.py
index 87f8624..220d88e 100644
--- a/io_scene_fbx/parse_fbx.py
+++ b/io_scene_fbx/parse_fbx.py
@@ -159,6 +159,8 @@ def parse(fn, use_namedtuple=True):
             raise IOError("Invalid header")
 
         fbx_version = read_uint(read)
+        if fbx_version >= 7500:
+            raise IOError("Unsupported FBX version (%d), binary format is incompatible!" % fbx_version)
 
         while True:
             elem = read_elem(read, tell, use_namedtuple)



More information about the Bf-extensions-cvs mailing list