# 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,
)
        if blender_data.parent and blender_data.parent_bone:
            parent_bone = blender_data.parent.data.bones[blender_data.parent_bone]
            bone_name = get_bone_name(parent_bone)
            if bone_name not in state['bone_children']:
                state['bone_children'][bone_name] = []
            state['bone_children'][bone_name].append(blender_data.name)

        if blender_data.type == 'MESH':
            decompose = state['decompose_mesh_fn']
            mesh = state['mod_meshes_obj'].get(blender_data.name, blender_data.data)
            mesh_name = mesh.name
            mesh = state['mod_meshes'].get(mesh.name, mesh)
            if state['version'] < Version('2.0'):
                node['meshes'] = []
                node['meshes'].append(Reference('meshes', mesh_name, node['meshes'], 0))
                state['references'].append(node['meshes'][0])
            else:
                node['mesh'] = Reference('meshes', mesh_name, node, 'mesh')
                state['references'].append(node['mesh'])
            armature = blender_data.find_armature()
            if armature:
                state['input']['skins'].append(blender_data)
                state['skinned_meshes'].add(mesh_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'] = []

# 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,
)

        if blender_data.parent and blender_data.parent_bone:
            parent_bone = blender_data.parent.data.bones[blender_data.parent_bone]
            bone_name = get_bone_name(parent_bone)
            if bone_name not in state['bone_children']:
                state['bone_children'][bone_name] = []
            state['bone_children'][bone_name].append(blender_data.name)

        if blender_data.type == 'MESH':
            decompose = state['decompose_mesh_fn']
            mesh = state['mod_meshes_obj'].get(blender_data.name, blender_data.data)
            mesh_name = mesh.name
            mesh = state['mod_meshes'].get(mesh.name, mesh)
            if state['version'] < Version('2.0'):
                node['meshes'] = []
                node['meshes'].append(Reference('meshes', mesh_name, node['meshes'], 0))
                state['references'].append(node['meshes'][0])
            else:
                node['mesh'] = Reference('meshes', mesh_name, node, 'mesh')
                state['references'].append(node['mesh'])
            armature = blender_data.find_armature()
            if armature:
                state['input']['skins'].append(blender_data)
                state['skinned_meshes'].add(mesh_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([