From d5a570ddb9d5c67ceec6fbd5bc684d1dd89f54e4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 1 Feb 2019 15:50:31 +0100 Subject: Fix T61096: fbx import crashes on file from mixamo. Blender only supports 8 UVMaps per mesh, avoid crashing addon when trying to import more. --- io_scene_fbx/__init__.py | 2 +- io_scene_fbx/import_fbx.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'io_scene_fbx') 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 -- cgit v1.2.3