[Bf-extensions-cvs] [d5a570dd] master: Fix T61096: fbx import crashes on file from mixamo.

Bastien Montagne noreply at git.blender.org
Fri Feb 1 15:51:22 CET 2019


Commit: d5a570ddb9d5c67ceec6fbd5bc684d1dd89f54e4
Author: Bastien Montagne
Date:   Fri Feb 1 15:50:31 2019 +0100
Branches: master
https://developer.blender.org/rBAd5a570ddb9d5c67ceec6fbd5bc684d1dd89f54e4

Fix T61096: fbx import crashes on file from mixamo.

Blender only supports 8 UVMaps per mesh, avoid crashing addon when
trying to import more.

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

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 77596c8a..6487bf01 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": (4, 14, 2),
+    "version": (4, 14, 3),
     "blender": (2, 80, 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 5a3287a2..b3f78660 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1007,6 +1007,11 @@ def blen_read_geom_layer_uv(fbx_obj, mesh):
             fbx_layer_index = elem_prop_first(elem_find_first(fbx_layer, b'UVIndex'))
 
             uv_lay = mesh.uv_layers.new(name=fbx_layer_name)
+            if uv_lay is None:
+                print("Failed to add {%r %r} UVLayer to %r (probably too many of them?)"
+                      "" % (layer_id, fbx_layer_name, mesh.name))
+                continue
+
             blen_data = uv_lay.data
 
             # some valid files omit this data



More information about the Bf-extensions-cvs mailing list