Skip to content
Snippets Groups Projects
Commit 1b85ce80 authored by Brecht Van Lommel's avatar Brecht Van Lommel
Browse files

Fix #33350: lightwave .lwo import of uv's and vertex colors was not working since bmesh.

parent 2581d089
No related branches found
No related tags found
No related merge requests found
...@@ -1088,8 +1088,9 @@ def build_objects(object_layers, object_surfs, object_tags, object_name, add_sub ...@@ -1088,8 +1088,9 @@ def build_objects(object_layers, object_surfs, object_tags, object_name, add_sub
print("Adding %d Vertex Color Maps" % len(layer_data.colmaps)) print("Adding %d Vertex Color Maps" % len(layer_data.colmaps))
for cmap_key in layer_data.colmaps: for cmap_key in layer_data.colmaps:
map_pack= create_mappack(layer_data, cmap_key, "COLOR") map_pack= create_mappack(layer_data, cmap_key, "COLOR")
vcol= me.vertex_colors.new(cmap_key) me.vertex_colors.new(cmap_key)
if not vcol: vcol= me.tessface_vertex_colors[-1]
if not vcol or not vcol.data:
break break
for fi in map_pack: for fi in map_pack:
if fi > len(vcol.data): if fi > len(vcol.data):
...@@ -1109,10 +1110,9 @@ def build_objects(object_layers, object_surfs, object_tags, object_name, add_sub ...@@ -1109,10 +1110,9 @@ def build_objects(object_layers, object_surfs, object_tags, object_name, add_sub
print("Adding %d UV Textures" % len(layer_data.uvmaps)) print("Adding %d UV Textures" % len(layer_data.uvmaps))
for uvmap_key in layer_data.uvmaps: for uvmap_key in layer_data.uvmaps:
map_pack= create_mappack(layer_data, uvmap_key, "UV") map_pack= create_mappack(layer_data, uvmap_key, "UV")
uvm= me.uv_textures.new(name=uvmap_key) me.uv_textures.new(name=uvmap_key)
uvloop = me.uv_layers[-1] uvm= me.tessface_uv_textures[-1]
uvm = uvloop.data if not uvm or not uvm.data:
if not uvm:
break break
for fi in map_pack: for fi in map_pack:
if fi > len(uvm.data): if fi > len(uvm.data):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment