[Bf-extensions-cvs] [ecb43fe] master: Fix T37553: Some FBX files have some '-1' (invalid) indices in mapped layers

Campbell Barton noreply at git.blender.org
Fri Nov 29 03:00:30 CET 2013


Commit: ecb43feb368597b25e0ca8b48888448e04c00cae
Author: Campbell Barton
Date:   Fri Nov 29 12:57:56 2013 +1100
http://developer.blender.org/rBAecb43feb368597b25e0ca8b48888448e04c00cae

Fix T37553: Some FBX files have some '-1' (invalid) indices in mapped layers

I can't find any docs on this but from checking the file these can be
safely ignored.

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

M	io_scene_fbx/import_fbx.py

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

diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 2b5bf3b..0f4df62 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -431,8 +431,9 @@ def blen_read_geom_array_mapped_polyloop(
         if fbx_layer_ref == b'IndexToDirect':
             assert(fbx_layer_index is not None)
             for i, j in enumerate(fbx_layer_index):
-                setattr(blen_data[i], blend_attr,
-                        fbx_layer_data[(j * stride): (j * stride) + item_size])
+                if j != -1:
+                    setattr(blen_data[i], blend_attr,
+                            fbx_layer_data[(j * stride): (j * stride) + item_size])
             return True
         else:
             print("warning layer %r ref type unsupported: %r" % (descr, fbx_layer_ref))



More information about the Bf-extensions-cvs mailing list