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...
This commit is contained in:
Bastien Montagne 2018-08-05 19:13:35 +02:00
parent c87ee4d46f
commit bea6ca0c4e
Notes: blender-bot 2023-02-14 05:53:39 +01:00
Referenced by issue blender/blender#55022, [fbx] when enable  use  tangent space ,it's throw bug.
2 changed files with 4 additions and 2 deletions

View File

@ -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",

View File

@ -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)