diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-09 13:44:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-09 13:44:24 +0400 |
commit | bd50a4e36867884b789aa209a0d85000105bb5be (patch) | |
tree | e25fcab011667d7d6d92ab3d342349aa55b28413 | |
parent | 01ed2d2f49f40b0d135bc4c129524ef5e5eda19e (diff) |
fix [#36995] FBX Importer does not import fbx model
-rw-r--r-- | io_scene_fbx/import_fbx.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index ab21ca77..f38b0499 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -497,6 +497,11 @@ def blen_read_geom_layer_uv(fbx_obj, mesh): uv_lay = mesh.uv_layers[-1] blen_data = uv_lay.data[:] + # some valid files omit this data + if fbx_layer_data is None or fbx_layer_index is None: + print("%r %r missing data" % (layer_id, fbx_layer_name)) + continue + blen_read_geom_array_mapped_polyloop( mesh, blen_data, "uv", fbx_layer_data, fbx_layer_index, @@ -521,6 +526,11 @@ def blen_read_geom_layer_color(fbx_obj, mesh): color_lay = mesh.vertex_colors.new(name=fbx_layer_name) blen_data = color_lay.data[:] + # some valid files omit this data + if fbx_layer_data is None or fbx_layer_index is None: + print("%r %r missing data" % (layer_id, fbx_layer_name)) + continue + # ignore alpha layer (read 4 items into 3) blen_read_geom_array_mapped_polyloop( mesh, blen_data, "color", |