# Path: addons/io_scene_gltf_ksons/compat.py
# def mul(x, y): return x @ y
# 
# Path: addons/io_scene_gltf_ksons/mesh.py
# def mesh_name(op, mesh_spec):
#     mesh_idx, primitive_idx = mesh_spec
#     name = op.gltf['meshes'][mesh_idx].get('name', 'meshes[%d]' % mesh_idx)
#     if primitive_idx is not None:
#         # Look for a name on the extras property
#         extras = op.gltf['meshes'][mesh_idx]['primitives'][primitive_idx].get('extras')
#         if type(extras) == dict and type(extras.get('name')) == str and extras['name']:
#             primitive_name = extras['name']
#         else:
#             primitive_name = 'primitives[%d]' % primitive_idx
#         name += '.' + primitive_name
#     return name


from math import pi
from mathutils import Matrix, Quaternion, Vector, Euler
from .compat import mul
from .mesh import mesh_name
        # gltf->Blender axis conversion
        if vnode.camera:
            move_instance_to_new_child(vnode, 'camera')
        if vnode.light:
            move_instance_to_new_child(vnode, 'light')

        if vnode.mesh and vnode.type == 'BONE':
            move_instance_to_new_child(vnode, 'mesh')

        for child in children:
            visit(child)

    visit(op.root_vnode)

    # The user can request that meshes be split into their primitives, like this
    #
    #       OBJ      =>     OBJ
    #      (mesh)         /  |  \
    #                  OBJ  OBJ  OBJ
    #                (mesh)(mesh)(mesh)
    if op.options['split_meshes']:
        def visit(vnode):
            children = list(vnode.children)

            if vnode.mesh is not None:
                num_prims = len(op.gltf['meshes'][vnode.mesh['mesh']]['primitives'])
                if num_prims > 1:
                    new_children = []
                    for prim_idx in range(0, num_prims):
                        child = VNode()

# Path: addons/io_scene_gltf_ksons/compat.py
# def mul(x, y): return x @ y
# 
# Path: addons/io_scene_gltf_ksons/mesh.py
# def mesh_name(op, mesh_spec):
#     mesh_idx, primitive_idx = mesh_spec
#     name = op.gltf['meshes'][mesh_idx].get('name', 'meshes[%d]' % mesh_idx)
#     if primitive_idx is not None:
#         # Look for a name on the extras property
#         extras = op.gltf['meshes'][mesh_idx]['primitives'][primitive_idx].get('extras')
#         if type(extras) == dict and type(extras.get('name')) == str and extras['name']:
#             primitive_name = extras['name']
#         else:
#             primitive_name = 'primitives[%d]' % primitive_idx
#         name += '.' + primitive_name
#     return name


# Path: addons/io_scene_gltf_ksons/vnode.py
from math import pi
from mathutils import Matrix, Quaternion, Vector, Euler
from .compat import mul
from .mesh import mesh_name

        # gltf->Blender axis conversion
        if vnode.camera:
            move_instance_to_new_child(vnode, 'camera')
        if vnode.light:
            move_instance_to_new_child(vnode, 'light')

        if vnode.mesh and vnode.type == 'BONE':
            move_instance_to_new_child(vnode, 'mesh')

        for child in children:
            visit(child)

    visit(op.root_vnode)

    # The user can request that meshes be split into their primitives, like this
    #
    #       OBJ      =>     OBJ
    #      (mesh)         /  |  \
    #                  OBJ  OBJ  OBJ
    #                (mesh)(mesh)(mesh)
    if op.options['split_meshes']:
        def visit(vnode):
            children = list(vnode.children)

            if vnode.mesh is not None:
                num_prims = len(op.gltf['meshes'][vnode.mesh['mesh']]['primitives'])
                if num_prims > 1:
                    new_children = []
                    for prim_idx in range(0, num_prims):
                        child = VNode()

                        child.name = mesh_name(op, (vnode.mesh['mesh'], prim_idx))