[Bf-extensions-cvs] [be2df524] blender2.8: glTF exporter: fix getting uv_layer in certain cases

Philipp Oeser noreply at git.blender.org
Sun Nov 25 10:44:27 CET 2018


Commit: be2df5249105015aaafb06def0d1279c559c56ff
Author: Philipp Oeser
Date:   Sun Nov 25 10:36:40 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBAbe2df5249105015aaafb06def0d1279c559c56ff

glTF exporter: fix getting uv_layer in certain cases

uv_textures > uv_layers

===================================================================

M	io_scene_gltf2/blender/exp/gltf2_blender_gather_material_normal_texture_info_class.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py
M	io_scene_gltf2/blender/exp/gltf2_blender_get.py

===================================================================

diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_normal_texture_info_class.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_normal_texture_info_class.py
index 0d314681..4599c7dc 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_normal_texture_info_class.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_normal_texture_info_class.py
@@ -90,7 +90,7 @@ def __gather_tex_coord(blender_shader_sockets_or_texture_slots, export_settings)
 
         # Try to gather map index.
         for blender_mesh in bpy.data.meshes:
-            texCoordIndex = blender_mesh.uv_textures.find(input_node.uv_map)
+            texCoordIndex = blender_mesh.uv_layers.find(input_node.uv_map)
             if texCoordIndex >= 0:
                 return texCoordIndex
 
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py
index af219318..c9c70e42 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py
@@ -90,7 +90,7 @@ def __gather_tex_coord(blender_shader_sockets_or_texture_slots, export_settings)
 
         # Try to gather map index.
         for blender_mesh in bpy.data.meshes:
-            texCoordIndex = blender_mesh.uv_textures.find(input_node.uv_map)
+            texCoordIndex = blender_mesh.uv_layers.find(input_node.uv_map)
             if texCoordIndex >= 0:
                 return texCoordIndex
 
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 149a2a84..225e686b 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
@@ -85,7 +85,7 @@ def __gather_tex_coord(blender_shader_sockets_or_texture_slots, export_settings)
 
         # Try to gather map index.
         for blender_mesh in bpy.data.meshes:
-            texCoordIndex = blender_mesh.uv_textures.find(input_node.uv_map)
+            texCoordIndex = blender_mesh.uv_layers.find(input_node.uv_map)
             if texCoordIndex >= 0:
                 return texCoordIndex
 
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_get.py b/io_scene_gltf2/blender/exp/gltf2_blender_get.py
index 27135224..468ba692 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_get.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_get.py
@@ -318,7 +318,7 @@ def get_texcoord_index_from_shader_node(glTF, name, shader_node):
 
     # Try to gather map index.
     for blender_mesh in bpy.data.meshes:
-        texCoordIndex = blender_mesh.uv_textures.find(input_node.uv_map)
+        texCoordIndex = blender_mesh.uv_layers.find(input_node.uv_map)
         if texCoordIndex >= 0:
             return texCoordIndex



More information about the Bf-extensions-cvs mailing list