[Bf-extensions-cvs] [7937fe2] master: Fix T45291: empty bytes/string nodes seems to be valid... *sigh*
Bastien Montagne
noreply at git.blender.org
Fri Jul 3 17:15:39 CEST 2015
Commit: 7937fe22df4a5fcfa931281aba1dfa05bb0ea4a1
Author: Bastien Montagne
Date: Fri Jul 3 16:54:26 2015 +0200
Branches: master
https://developer.blender.org/rBA7937fe22df4a5fcfa931281aba1dfa05bb0ea4a1
Fix T45291: empty bytes/string nodes seems to be valid... *sigh*
===================================================================
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 4d5b32b..42321cf 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, 4, 1),
+ "version": (3, 4, 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 eed332a..5d292b1 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]
More information about the Bf-extensions-cvs
mailing list