[Bf-extensions-cvs] [e9de9ee] master: Fix T46910: FBX import error due to unrecognized property flags set.

Bastien Montagne noreply at git.blender.org
Wed Dec 2 12:21:16 CET 2015


Commit: e9de9eed5d91aedded71131118b0252aa078b947
Author: Bastien Montagne
Date:   Wed Dec 2 12:18:29 2015 +0100
Branches: master
https://developer.blender.org/rBAe9de9eed5d91aedded71131118b0252aa078b947

Fix T46910: FBX import error due to unrecognized property flags set.

Get rid of those flags asserts in read code, we do not use them anyway, and our goal is not
to be a FBX format validator, especially since there is no public FBX format...

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

M	io_scene_fbx/__init__.py
M	io_scene_fbx/data_types.py
M	io_scene_fbx/import_fbx.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index b3c05e5..6e23b49 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, 6, 3),
+    "version": (3, 6, 4),
     "blender": (2, 76, 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/data_types.py b/io_scene_fbx/data_types.py
index 3a505be..129806c 100644
--- a/io_scene_fbx/data_types.py
+++ b/io_scene_fbx/data_types.py
@@ -36,6 +36,10 @@ FLOAT64_ARRAY = b'd'[0]
 BOOL_ARRAY = b'b'[0]
 BYTE_ARRAY = b'c'[0]
 
+# Some other misc defines
+# Known combinations so far - supposed meaning: A = animatable, A+ = animated, U = UserProp
+# VALID_NUMBER_FLAGS = {b'A', b'A+', b'AU', b'A+U'}  # Not used...
+
 # array types - actual length may vary (depending on underlying C implementation)!
 import array
 
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 128dab1..d3dbf98 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -184,7 +184,6 @@ def elem_props_get_color_rgb(elem, elem_prop_id, default=None):
             # FBX version 7300
             assert(elem_prop.props[1] == b'Color')
             assert(elem_prop.props[2] == b'')
-            assert(elem_prop.props[3] in {b'A', b'A+', b'AU'})
         else:
             assert(elem_prop.props[1] == b'ColorRGB')
             assert(elem_prop.props[2] == b'Color')
@@ -211,7 +210,6 @@ def elem_props_get_number(elem, elem_prop_id, default=None):
         else:
             assert(elem_prop.props[1] == b'Number')
             assert(elem_prop.props[2] == b'')
-            assert(elem_prop.props[3] in {b'A', b'A+', b'AU'})
 
         # we could allow other number types
         assert(elem_prop.props_type[4] == data_types.FLOAT64)
@@ -275,7 +273,6 @@ def elem_props_get_visibility(elem, elem_prop_id, default=None):
         assert(elem_prop.props[0] == elem_prop_id)
         assert(elem_prop.props[1] == b'Visibility')
         assert(elem_prop.props[2] == b'')
-        assert(elem_prop.props[3] in {b'A', b'A+', b'AU'})
 
         # we could allow other number types
         assert(elem_prop.props_type[4] == data_types.FLOAT64)



More information about the Bf-extensions-cvs mailing list