#  ***** BEGIN GPL LICENSE BLOCK *****
#
#   Copyright (C) 2024 Ilia Kurochkin <brothermechanic@yandex.com>
#
#   Created by Ilia Kurochkin (brothermechanic)
#   contact:    brothermechanic@yandex.com
#
#   This is free software;
#   you can redistribute it and/or modify
#   it under the terms of the GNU General Public License
#   as published by the Free Software Foundation; either version 3
#   of the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, see <https://www.gnu.org/licenses/>.
#
#  ***** END GPL LICENSE BLOCK *****
#
# coding: utf-8
'''
DESCRIPTION.
Collada object exporter.
'''

__version__ = '0.3'

import bpy
from . import export_decorator


@export_decorator
def export(**kwargs):
    file_path = ('{}.dae'.format(kwargs['outpath']))

    bpy.ops.wm.collada_export(
        filepath=file_path,
        check_existing=False,
        apply_modifiers=True,
        export_mesh_type=0,
        export_mesh_type_selection='view',
        export_global_forward_selection=kwargs['axis_forward'],
        export_global_up_selection=kwargs['axis_up'],
        apply_global_orientation=False,
        selected=True,
        include_children=False,
        include_armatures=False,
        include_shapekeys=False,
        deform_bones_only=False,
        include_animations=False,
        include_all_actions=True,
        export_animation_type_selection='sample',
        sampling_rate=1,
        keep_smooth_curves=False,
        keep_keyframes=False,
        keep_flat_curves=False,
        active_uv_only=False,
        use_texture_copies=True,
        triangulate=True,
        use_object_instantiation=True,
        use_blender_profile=True,
        sort_by_name=False,
        export_object_transformation_type=0,
        export_object_transformation_type_selection='matrix',
        export_animation_transformation_type=0,
        export_animation_transformation_type_selection='matrix',
        open_sim=False,
        limit_precision=False,
        keep_bind_info=False)

    return file_path
