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