diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-05 23:46:14 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-05 23:46:14 +0300 |
commit | 91d241f5b7df9a3806072765cc5371c5ee34dbd7 (patch) | |
tree | 2ee31208ee7c99f2cd6f90adaa7bf12f676f5c05 | |
parent | cd598b76e5fc943b4cfb4754a89cfdf79c73002f (diff) |
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.
-rw-r--r-- | io_scene_fbx/__init__.py | 2 | ||||
-rw-r--r-- | io_scene_fbx/import_fbx.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 6487bf01..ce7f748f 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, 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", diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index b3f78660..08b7c0fe 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -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 |