From bea6ca0c4ef8b838ab6d2bc63136b52eb3ffc63c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 5 Aug 2018 19:13:35 +0200 Subject: Fix T55022: [fbx] when enable use tangent space ,it's throw bug. calculating tangent for some reasons recompute mesh' UV layers, so we cannot use iterators on those... --- io_scene_fbx/__init__.py | 2 +- io_scene_fbx/export_fbx_bin.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 9611cb1f..920ddc4c 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": (3, 9, 1), + "version": (3, 9, 2), "blender": (2, 79, 1), "location": "File > Import-Export", "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions", diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index b75a8977..2df62e3f 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -1023,9 +1023,11 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes): if tspacenumber: t_ln = array.array(data_types.ARRAY_FLOAT64, (0.0,)) * len(me.loops) * 3 # t_lnw = array.array(data_types.ARRAY_FLOAT64, (0.0,)) * len(me.loops) + uv_names = [uvlayer.name for uvlayer in me.uv_layers] + for name in uv_names: + me.calc_tangents(name) for idx, uvlayer in enumerate(me.uv_layers): name = uvlayer.name - me.calc_tangents(name) # Loop bitangents (aka binormals). # NOTE: this is not supported by importer currently. me.loops.foreach_get("bitangent", t_ln) -- cgit v1.2.3