Skip to content
Snippets Groups Projects
Commit bccd6c66 authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: fix resolve uvmap index, using now correct mesh

parent 3908254f
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 4, 18),
"version": (3, 4, 19),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
......
......@@ -166,12 +166,15 @@ def __gather_texture_transform_and_tex_coord(primary_socket, export_settings):
use_active_uvmap = True
if node and node.type == 'UVMAP' and node.uv_map:
# Try to gather map index.
for blender_mesh in bpy.data.meshes:
i = blender_mesh.uv_layers.find(node.uv_map)
if i >= 0:
texcoord_idx = i
use_active_uvmap = False
break
node_tree = node.id_data
for mesh in bpy.data.meshes:
for material in mesh.materials:
if material.node_tree == node_tree:
i = mesh.uv_layers.find(node.uv_map)
if i >= 0:
texcoord_idx = i
use_active_uvmap = False
break
return texture_transform, texcoord_idx or None, use_active_uvmap
......
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