glTF exporter: Fix T65622 Check if texture has a valid image

This commit is contained in:
Julien Duroure 2019-08-03 07:08:14 +02:00
parent 6f0585fa4a
commit 2c08beb969
Notes: blender-bot 2023-02-14 19:14:23 +01:00
Referenced by issue #66441, Export as gltf2
Referenced by issue #65622, gltf exporter errors
4 changed files with 14 additions and 1 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (0, 9, 36),
"version": (0, 9, 37),
'blender': (2, 80, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
@ -595,3 +595,4 @@ def unregister():
# remove from the export / import menu
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)

View File

@ -38,6 +38,9 @@ def gather_material_normal_texture_info_class(blender_shader_sockets_or_texture_
tex_coord=__gather_tex_coord(blender_shader_sockets_or_texture_slots, export_settings)
)
if texture_info.index is None:
return None
return texture_info
@ -135,5 +138,7 @@ def __get_tex_from_socket(socket):
gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeTexImage))
if not result:
return None
if result[0].shader_node.image is None:
return None
return result[0]

View File

@ -35,6 +35,9 @@ def gather_material_occlusion_texture_info_class(blender_shader_sockets_or_textu
tex_coord=__gather_tex_coord(blender_shader_sockets_or_texture_slots, export_settings)
)
if texture_info.index is None:
return None
return texture_info
@ -109,5 +112,7 @@ def __get_tex_from_socket(socket):
gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeTexImage))
if not result:
return None
if result[0].shader_node.image is None:
return None
return result[0]

View File

@ -132,5 +132,7 @@ def __get_tex_from_socket(socket):
gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeTexImage))
if not result:
return None
if result[0].shader_node.image is None:
return None
return result[0]