Fix T62224: FBX importer dosen't import uv-maps correctly when there is 2 or more maps.

Do not do 'smart' init of our UV/VCol data layers, this is lost
computation and can generate issues when not all items are explicitely
defined in FBX file.
This commit is contained in:
Bastien Montagne 2019-03-05 21:46:14 +01:00
parent cd598b76e5
commit 91d241f5b7
Notes: blender-bot 2023-02-14 19:18:52 +01:00
Referenced by issue #62224, FBX importer dosen't import uv-maps correctly when there is 2 or more maps (possible fix suggestion here too)
2 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
"version": (4, 14, 3),
"version": (4, 14, 4),
"blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",

View File

@ -1006,7 +1006,8 @@ def blen_read_geom_layer_uv(fbx_obj, mesh):
fbx_layer_data = elem_prop_first(elem_find_first(fbx_layer, b'UV'))
fbx_layer_index = elem_prop_first(elem_find_first(fbx_layer, b'UVIndex'))
uv_lay = mesh.uv_layers.new(name=fbx_layer_name)
# Always init our new layers with (0, 0) UVs.
uv_lay = mesh.uv_layers.new(name=fbx_layer_name, do_init=False)
if uv_lay is None:
print("Failed to add {%r %r} UVLayer to %r (probably too many of them?)"
"" % (layer_id, fbx_layer_name, mesh.name))
@ -1040,7 +1041,8 @@ def blen_read_geom_layer_color(fbx_obj, mesh):
fbx_layer_data = elem_prop_first(elem_find_first(fbx_layer, b'Colors'))
fbx_layer_index = elem_prop_first(elem_find_first(fbx_layer, b'ColorIndex'))
color_lay = mesh.vertex_colors.new(name=fbx_layer_name)
# Always init our new layers with full white opaque color.
color_lay = mesh.vertex_colors.new(name=fbx_layer_name, do_init=False)
blen_data = color_lay.data
# some valid files omit this data