Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-07-03 17:54:26 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-07-03 17:54:26 +0300
commit7937fe22df4a5fcfa931281aba1dfa05bb0ea4a1 (patch)
treeb902b01d579f5fbff6ae47cd02bc039a702875d1 /io_scene_fbx/import_fbx.py
parent318e225c69f2a6c492b28ea7586e99c70a65b079 (diff)
Fix T45291: empty bytes/string nodes seems to be valid... *sigh*
Diffstat (limited to 'io_scene_fbx/import_fbx.py')
-rw-r--r--io_scene_fbx/import_fbx.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index eed332af..5d292b1e 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -76,7 +76,7 @@ def elem_find_iter(elem, id_search):
def elem_find_first_string(elem, id_search):
fbx_item = elem_find_first(elem, id_search)
- if fbx_item is not None:
+ if fbx_item is not None and fbx_item.props: # Do not error on complete empty properties (see T45291).
assert(len(fbx_item.props) == 1)
assert(fbx_item.props_type[0] == data_types.STRING)
return fbx_item.props[0].decode('utf-8')
@@ -85,7 +85,7 @@ def elem_find_first_string(elem, id_search):
def elem_find_first_string_as_bytes(elem, id_search):
fbx_item = elem_find_first(elem, id_search)
- if fbx_item is not None:
+ if fbx_item is not None and fbx_item.props: # Do not error on complete empty properties (see T45291).
assert(len(fbx_item.props) == 1)
assert(fbx_item.props_type[0] == data_types.STRING)
return fbx_item.props[0] # Keep it as bytes as requested...
@@ -94,7 +94,7 @@ def elem_find_first_string_as_bytes(elem, id_search):
def elem_find_first_bytes(elem, id_search, decode=True):
fbx_item = elem_find_first(elem, id_search)
- if fbx_item is not None:
+ if fbx_item is not None and fbx_item.props: # Do not error on complete empty properties (see T45291).
assert(len(fbx_item.props) == 1)
assert(fbx_item.props_type[0] == data_types.BYTES)
return fbx_item.props[0]