# 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/exporters/common.py
# class Reference:
#     __slots__ = (
#         "blender_type",
#         "blender_name",
#         "source",
#         "prop",
#         "value",
#     )
# 
#     def __init__(self, blender_type, blender_name, source, prop):
#         self.blender_type = blender_type
#         self.blender_name = blender_name
#         self.source = source
#         self.prop = prop
#         self.value = None
# 
#     def __str__(self):
#         return json.dumps([self.blender_type, self.blender_name, self.value])
# 
# class SimpleID:
#     def __init__(self, name, data=None):
#         self.name = name
#         self.data = data
# 
# def get_bone_name(bone):
#     return '{}_{}'.format(bone.id_data.name, bone.name)


from distutils.version import StrictVersion as Version
from .base import BaseExporter
from .common import (
    Reference,
    SimpleID,
    get_bone_name,
)
                node['skin'] = Reference('skins', blender_data.name, node, 'skin')
                state['references'].append(node['skin'])
                if state['version'] < Version('2.0'):
                    bone_names = [
                        get_bone_name(b) for b in armature.data.bones if b.parent is None
                    ]
                    node['skeletons'] = []
                    node['skeletons'].extend([
                        Reference('objects', bone, node['skeletons'], i)
                        for i, bone in enumerate(bone_names)
                    ])
                    for ref in node['skeletons']:
                        state['references'].append(ref)
        elif blender_data.type == 'CAMERA':
            node['camera'] = Reference('cameras', blender_data.data.name, node, 'camera')
            state['references'].append(node['camera'])
        elif blender_data.type == 'EMPTY' and blender_data.dupli_group is not None:
            node['children'] = node.get('children', [])
            node['children'].append(cls.export_dupli_group(state, blender_data.dupli_group))
            node['children'][-1].source = node['children']
            node['children'][-1].prop = len(node['children']) - 1
        elif blender_data.type == 'ARMATURE':
            decompose = state['decompose_mesh_fn']
            for i, bone in enumerate(blender_data.data.bones):
                state['input']['bones'].append(SimpleID(get_bone_name(bone), bone))
            if 'children' not in node:
                node['children'] = []
            offset = len(node['children'])
            root_bones = [bone for bone in blender_data.data.bones if bone.parent is None]
            root_refs = [

# 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/exporters/common.py
# class Reference:
#     __slots__ = (
#         "blender_type",
#         "blender_name",
#         "source",
#         "prop",
#         "value",
#     )
# 
#     def __init__(self, blender_type, blender_name, source, prop):
#         self.blender_type = blender_type
#         self.blender_name = blender_name
#         self.source = source
#         self.prop = prop
#         self.value = None
# 
#     def __str__(self):
#         return json.dumps([self.blender_type, self.blender_name, self.value])
# 
# class SimpleID:
#     def __init__(self, name, data=None):
#         self.name = name
#         self.data = data
# 
# def get_bone_name(bone):
#     return '{}_{}'.format(bone.id_data.name, bone.name)


# Path: blendergltf/exporters/node.py
from distutils.version import StrictVersion as Version
from .base import BaseExporter
from .common import (
    Reference,
    SimpleID,
    get_bone_name,
)

                node['skin'] = Reference('skins', blender_data.name, node, 'skin')
                state['references'].append(node['skin'])
                if state['version'] < Version('2.0'):
                    bone_names = [
                        get_bone_name(b) for b in armature.data.bones if b.parent is None
                    ]
                    node['skeletons'] = []
                    node['skeletons'].extend([
                        Reference('objects', bone, node['skeletons'], i)
                        for i, bone in enumerate(bone_names)
                    ])
                    for ref in node['skeletons']:
                        state['references'].append(ref)
        elif blender_data.type == 'CAMERA':
            node['camera'] = Reference('cameras', blender_data.data.name, node, 'camera')
            state['references'].append(node['camera'])
        elif blender_data.type == 'EMPTY' and blender_data.dupli_group is not None:
            node['children'] = node.get('children', [])
            node['children'].append(cls.export_dupli_group(state, blender_data.dupli_group))
            node['children'][-1].source = node['children']
            node['children'][-1].prop = len(node['children']) - 1
        elif blender_data.type == 'ARMATURE':
            decompose = state['decompose_mesh_fn']
            for i, bone in enumerate(blender_data.data.bones):
                state['input']['bones'].append(SimpleID(get_bone_name(bone), bone))
            if 'children' not in node:
                node['children'] = []
            offset = len(node['children'])
            root_bones = [bone for bone in blender_data.data.bones if bone.parent is None]
            root_refs = [

                Reference('objects', get_bone_name(b), node['children'], i + offset)