Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2022-09-25 17:56:06 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-09-25 17:56:06 +0300
commitbccd6c669db6dbbf9901ea806780afaca62d5cb2 (patch)
treec274c9bbc433e0f7c99ad07d4cc0f30b8976b3a6
parent3908254f0938a3c4c29189a455c8e356771e6ce1 (diff)
glTF exporter: fix resolve uvmap index, using now correct mesh
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py15
2 files changed, 10 insertions, 7 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 07e4824a..1eeb3e11 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -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',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py
index 5fe2da32..01d261be 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py
@@ -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