Fix T53254: Fbx import assertion error on some Enum custom property.

Do not try to get some string namecode of Enum items if string part of
the custom FBX Enum property is empty! Just stick to basic int value in
this case.
This commit is contained in:
Bastien Montagne 2017-11-06 15:57:18 +01:00
parent 7a75719ec3
commit e00cbb80bc
Notes: blender-bot 2023-02-14 19:33:16 +01:00
Referenced by issue #53254, Fbx import assertion error(unknown location -1)
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
"version": (3, 8, 3),
"version": (3, 8, 4),
"blender": (2, 79, 1),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",

View File

@ -343,7 +343,7 @@ def blen_read_custom_properties(fbx_obj, blen_obj, settings):
elif prop_type in {b'Enum', b'enum'}:
assert(fbx_prop.props_type[4:6] == bytes((data_types.INT32, data_types.STRING)))
val = fbx_prop.props[4]
if settings.use_custom_props_enum_as_string:
if settings.use_custom_props_enum_as_string and fbx_prop.props[5]:
enum_items = fbx_prop.props[5].decode('utf-8').split('~')
assert(val >= 0 and val < len(enum_items))
blen_obj[prop_name] = enum_items[val]