diff options
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_material_occlusion_texture_info_class.py | 16 |
1 files changed, 15 insertions, 1 deletions
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 6fb543c0..4c4297ce 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 @@ -18,6 +18,8 @@ from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.blender.exp import gltf2_blender_gather_texture from io_scene_gltf2.blender.exp import gltf2_blender_search_node_tree +from io_scene_gltf2.blender.exp import gltf2_blender_get +from io_scene_gltf2.io.com.gltf2_io_extensions import Extension @cached @@ -54,7 +56,19 @@ def __filter_texture_info(blender_shader_sockets_or_texture_slots, export_settin def __gather_extensions(blender_shader_sockets_or_texture_slots, export_settings): - return None + if not hasattr(blender_shader_sockets_or_texture_slots[0], 'links'): + return None + + tex_nodes = [__get_tex_from_socket(socket).shader_node for socket in blender_shader_sockets_or_texture_slots] + texture_node = tex_nodes[0] if (tex_nodes is not None and len(tex_nodes) > 0) else None + if texture_node is None: + return None + texture_transform = gltf2_blender_get.get_texture_transform_from_texture_node(texture_node) + if texture_transform is None: + return None + + extension = Extension("KHR_texture_transform", texture_transform) + return {"KHR_texture_transform": extension} def __gather_extras(blender_shader_sockets_or_texture_slots, export_settings): |