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

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

parent 6f0585fa
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......@@ -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]
......@@ -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]
......@@ -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]
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