Skip to content
Snippets Groups Projects
Commit bd50a4e3 authored by Campbell Barton's avatar Campbell Barton
Browse files

fix [#36995] FBX Importer does not import fbx model

parent 01ed2d2f
No related branches found
No related tags found
No related merge requests found
...@@ -497,6 +497,11 @@ def blen_read_geom_layer_uv(fbx_obj, mesh): ...@@ -497,6 +497,11 @@ def blen_read_geom_layer_uv(fbx_obj, mesh):
uv_lay = mesh.uv_layers[-1] uv_lay = mesh.uv_layers[-1]
blen_data = uv_lay.data[:] 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( blen_read_geom_array_mapped_polyloop(
mesh, blen_data, "uv", mesh, blen_data, "uv",
fbx_layer_data, fbx_layer_index, fbx_layer_data, fbx_layer_index,
...@@ -521,6 +526,11 @@ def blen_read_geom_layer_color(fbx_obj, mesh): ...@@ -521,6 +526,11 @@ def blen_read_geom_layer_color(fbx_obj, mesh):
color_lay = mesh.vertex_colors.new(name=fbx_layer_name) color_lay = mesh.vertex_colors.new(name=fbx_layer_name)
blen_data = color_lay.data[:] 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) # ignore alpha layer (read 4 items into 3)
blen_read_geom_array_mapped_polyloop( blen_read_geom_array_mapped_polyloop(
mesh, blen_data, "color", mesh, blen_data, "color",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment