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.
This commit is contained in:
Bastien Montagne 2016-09-22 16:55:38 +02:00
parent 4ed120fafb
commit 80cfaeca09
Notes: blender-bot 2023-02-14 19:45:23 +01:00
Referenced by issue #49412, FBX importer not importing mudbox FBX's
4 changed files with 7 additions and 3 deletions

View File

@ -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",

View File

@ -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)

View File

@ -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:

View File

@ -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)