# Path: blendergltf/blendergltf.py
# DEFAULT_SETTINGS = {
#     'gltf_output_dir': '',
#     'gltf_name': 'gltf',
#     'gltf_export_binary': False,
#     'buffers_embed_data': True,
#     'buffers_combine_data': False,
#     'nodes_export_hidden': False,
#     'nodes_global_matrix': mathutils.Matrix.Identity(4),
#     'nodes_global_matrix_apply': True,
#     'nodes_selected_only': False,
#     'blocks_prune_unused': True,
#     'meshes_apply_modifiers': True,
#     'meshes_interleave_vertex_data': True,
#     'meshes_vertex_color_alpha': True,
#     'images_data_storage': 'COPY',
#     'asset_version': '2.0',
#     'asset_copyright': '',
#     'asset_profile': 'WEB',
#     'images_allow_srgb': False,
#     'extension_exporters': [],
#     'animations_object_export': 'ACTIVE',
#     'animations_armature_export': 'ELIGIBLE',
#     'animations_shape_key_export': 'ELIGIBLE',
#     'hacks_streaming': False,
# }
# PROFILE_MAP = {
#     'WEB': {'api': 'WebGL', 'version': '1.0'},
#     'DESKTOP': {'api': 'OpenGL', 'version': '3.0'}
# }
# def togl(matrix):
# def _decompose(matrix):
# def export_joint(state, bone):
# def export_buffers(state):
# def insert_root_nodes(state, root_matrix):
# def build_string_refmap(input_data):
# def build_int_refmap(input_data):
# def initialize_state(settings=None):
# def export_gltf(scene_delta, settings=None):
#         def decompose_apply(matrix):
#         def decompose_mesh_apply(matrix):
# 
# Path: blendergltf/exporters/base.py
# class BaseExporter:
#     gltf_key = ''
#     blender_key = ''
# 
#     @classmethod
#     def get_custom_properties(cls, blender_data):
#         custom_props = {
#             key: value.to_list() if hasattr(value, 'to_list') else value
#             for key, value in blender_data.items()
#             if key not in _IGNORED_CUSTOM_PROPS
#         }
# 
#         custom_props = {
#             key: value for key, value in custom_props.items()
#             if _is_serializable(value)
#         }
# 
#         return custom_props
# 
#     @classmethod
#     def check(cls, state, blender_data):
#         return True
# 
#     @classmethod
#     def default(cls, state, blender_data):
#         return {
#             'name': blender_data.name
#         }
# 
#     @classmethod
#     def export(cls, state, blender_data):
#         return {}


from distutils.version import StrictVersion as Version
from ..blendergltf import Reference
from ..exporters import BaseExporter
    else:
        print("Unsupported lamp type on {}: {}".format(light.name, light.type))
        gltf_light = {'type': 'unsupported'}

    gltf_light['name'] = light.name

    extras = BaseExporter.get_custom_properties(light)
    if extras:
        gltf_light['extras'] = extras

    return gltf_light


def export_lights(state, extension_name):
    # Export lights
    state['output']['extensions'] = state['output'].get('extensions', {})
    state['output']['extensions'][extension_name] = {
        'lights': [export_light(lamp) for lamp in state['input'].get('lamps', [])]
    }

    # Add light references to nodes
    obj_pairs = [
        (obj, state['output']['nodes'][state['refmap'][('objects', obj.name)]])
        for obj in state['input']['objects']
    ]

    for obj, node in obj_pairs:
        if getattr(obj, 'type', '') == 'LAMP':
            node['extensions'] = node.get('extensions', {})
            ext = node['extensions'][extension_name] = {}

# Path: blendergltf/blendergltf.py
# DEFAULT_SETTINGS = {
#     'gltf_output_dir': '',
#     'gltf_name': 'gltf',
#     'gltf_export_binary': False,
#     'buffers_embed_data': True,
#     'buffers_combine_data': False,
#     'nodes_export_hidden': False,
#     'nodes_global_matrix': mathutils.Matrix.Identity(4),
#     'nodes_global_matrix_apply': True,
#     'nodes_selected_only': False,
#     'blocks_prune_unused': True,
#     'meshes_apply_modifiers': True,
#     'meshes_interleave_vertex_data': True,
#     'meshes_vertex_color_alpha': True,
#     'images_data_storage': 'COPY',
#     'asset_version': '2.0',
#     'asset_copyright': '',
#     'asset_profile': 'WEB',
#     'images_allow_srgb': False,
#     'extension_exporters': [],
#     'animations_object_export': 'ACTIVE',
#     'animations_armature_export': 'ELIGIBLE',
#     'animations_shape_key_export': 'ELIGIBLE',
#     'hacks_streaming': False,
# }
# PROFILE_MAP = {
#     'WEB': {'api': 'WebGL', 'version': '1.0'},
#     'DESKTOP': {'api': 'OpenGL', 'version': '3.0'}
# }
# def togl(matrix):
# def _decompose(matrix):
# def export_joint(state, bone):
# def export_buffers(state):
# def insert_root_nodes(state, root_matrix):
# def build_string_refmap(input_data):
# def build_int_refmap(input_data):
# def initialize_state(settings=None):
# def export_gltf(scene_delta, settings=None):
#         def decompose_apply(matrix):
#         def decompose_mesh_apply(matrix):
# 
# Path: blendergltf/exporters/base.py
# class BaseExporter:
#     gltf_key = ''
#     blender_key = ''
# 
#     @classmethod
#     def get_custom_properties(cls, blender_data):
#         custom_props = {
#             key: value.to_list() if hasattr(value, 'to_list') else value
#             for key, value in blender_data.items()
#             if key not in _IGNORED_CUSTOM_PROPS
#         }
# 
#         custom_props = {
#             key: value for key, value in custom_props.items()
#             if _is_serializable(value)
#         }
# 
#         return custom_props
# 
#     @classmethod
#     def check(cls, state, blender_data):
#         return True
# 
#     @classmethod
#     def default(cls, state, blender_data):
#         return {
#             'name': blender_data.name
#         }
# 
#     @classmethod
#     def export(cls, state, blender_data):
#         return {}


# Path: blendergltf/extension_exporters/_lights_common.py
from distutils.version import StrictVersion as Version
from ..blendergltf import Reference
from ..exporters import BaseExporter

    else:
        print("Unsupported lamp type on {}: {}".format(light.name, light.type))
        gltf_light = {'type': 'unsupported'}

    gltf_light['name'] = light.name

    extras = BaseExporter.get_custom_properties(light)
    if extras:
        gltf_light['extras'] = extras

    return gltf_light


def export_lights(state, extension_name):
    # Export lights
    state['output']['extensions'] = state['output'].get('extensions', {})
    state['output']['extensions'][extension_name] = {
        'lights': [export_light(lamp) for lamp in state['input'].get('lamps', [])]
    }

    # Add light references to nodes
    obj_pairs = [
        (obj, state['output']['nodes'][state['refmap'][('objects', obj.name)]])
        for obj in state['input']['objects']
    ]

    for obj, node in obj_pairs:
        if getattr(obj, 'type', '') == 'LAMP':
            node['extensions'] = node.get('extensions', {})
            ext = node['extensions'][extension_name] = {}

            ext['light'] = Reference('lamps', obj.data.name, ext, 'light')