Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-06-25 17:58:15 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-06-26 15:08:58 +0300
commit5e564f9304a03380fc97bfad24121289fceb65dc (patch)
treeb83388fbf67ec0ad3fdfcf44400c6391ebd3fe8e /io_scene_fbx
parentaf03b63e256a3f656537e56b876cd6ade9b3ff16 (diff)
Fix T78083: FBX import: handle missing LayerElementNormal data more
gracefully If the 'Include Custom Normals' import option is used, and the FBX looks like it has LayerElementNormal (but lacks the actual data), dont throw an error, just print a warning and continue. (this has a downside, since such stuff can easily go unnoticed then, but this seems to be done elsewhere as well...) Maniphest Tasks: T78083 Differential Revision: https://developer.blender.org/D8122
Diffstat (limited to 'io_scene_fbx')
-rw-r--r--io_scene_fbx/__init__.py2
-rw-r--r--io_scene_fbx/import_fbx.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index b412d35f..e5fa3284 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, 21, 2),
+ "version": (4, 21, 3),
"blender": (2, 90, 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 6664be4e..3e0b2bfd 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1203,6 +1203,10 @@ def blen_read_geom_layer_normal(fbx_obj, mesh, xform=None):
fbx_layer_data = elem_prop_first(elem_find_first(fbx_layer, layer_id))
fbx_layer_index = elem_prop_first(elem_find_first(fbx_layer, b'NormalsIndex'))
+ if fbx_layer_data is None:
+ print("warning %r %r missing data" % (layer_id, fbx_layer_name))
+ return False
+
# try loops, then vertices.
tries = ((mesh.loops, "Loops", False, blen_read_geom_array_mapped_polyloop),
(mesh.polygons, "Polygons", True, blen_read_geom_array_mapped_polygon),