CG Pileline: add export to PLY script and optional scale and forward-up axis

This commit is contained in:
brothermechanic 2023-12-08 11:12:01 +03:00
parent 679a52a041
commit b77687ea14
No known key found for this signature in database
GPG key ID: 9C59EF9503ACD106
5 changed files with 49 additions and 5 deletions

40
cg/blender/export/ply.py Normal file
View file

@ -0,0 +1,40 @@
# coding: utf-8
# Copyright (C) 2023 Ilia Kurochkin <brothermechanic@yandex.com>
#
# This program 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.
'''
DESCRIPTION.
PLY mesh exporter.
'''
__version__ = "0.2"
import bpy
from blender.export import export_decorator
@export_decorator
def export_ply(**kwargs):
outpath = ('{}.ply'.format(kwargs['outpath']))
bpy.ops.export_mesh.ply(filepath=outpath,
check_existing=False,
filter_glob="*.ply",
use_ascii=True,
use_selection=True,
use_mesh_modifiers=True,
use_normals=True,
use_uv_coords=True,
use_colors=True,
global_scale=kwargs['global_scale'],
axis_forward=kwargs['axis_forward'],
axis_up=kwargs['axis_up'])
return outpath