2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2009 Blender Foundation.
19 * All rights reserved.
22 * Contributor(s): Blender Foundation
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/makesrna/intern/rna_mesh_api.c
35 #include "RNA_define.h"
37 #include "BLO_sys_types.h"
43 const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2)
45 const char *ret = mesh_cmp(mesh, mesh2, FLT_EPSILON*60);
55 void RNA_api_mesh(StructRNA *srna)
60 func = RNA_def_function(srna, "transform", "ED_mesh_transform");
61 RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix");
62 parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
63 RNA_def_property_flag(parm, PROP_REQUIRED);
65 func = RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
66 RNA_def_function_ui_description(func, "Calculate vertex normals");
68 func = RNA_def_function(srna, "update", "ED_mesh_update");
69 RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
70 RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces");
71 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
73 func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
74 parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
75 RNA_def_function_flag(func, FUNC_USE_CONTEXT);
77 parm = RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");
78 RNA_def_function_return(func, parm);
80 func = RNA_def_function(srna, "validate", "BKE_mesh_validate");
81 RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had "
82 "invalid geometry corrected/removed");
83 RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
84 parm = RNA_def_boolean(func, "result", 0, "Result", "");
85 RNA_def_function_return(func, parm);