rcg-pipeline/rcg_pipeline/export/stl.py

52 lines
1.5 KiB
Python

# ***** 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.
STL object exporter.
'''
__version__ = '0.3'
import bpy
from . import export_decorator
@export_decorator
def export(**kwargs):
file_path = ('{}.stl'.format(kwargs['outpath']))
bpy.ops.wm.stl_export(
filepath=file_path,
check_existing=False,
ascii_format=False,
use_batch=False,
export_selected_objects=True,
global_scale=kwargs['global_scale'],
use_scene_unit=False,
forward_axis=kwargs['axis_forward'],
up_axis=kwargs['axis_up'],
apply_modifiers=True)
return file_path