44
44
#include "rna_internal.h" /* own include */
48
#include "DNA_mesh_types.h"
47
50
static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2)
49
52
const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60);
60
void rna_Mesh_calc_smooth_groups(struct Mesh *mesh, int *r_poly_group_len, int **r_poly_group, int *r_group_total)
62
*r_poly_group_len = mesh->totpoly;
63
*r_poly_group = BKE_mesh_calc_smoothgroups(
64
mesh->medge, mesh->totedge,
65
mesh->mpoly, mesh->totpoly,
66
mesh->mloop, mesh->totloop,
59
72
void RNA_api_mesh(StructRNA *srna)
66
79
parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
67
80
RNA_def_property_flag(parm, PROP_REQUIRED);
69
func = RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
82
func = RNA_def_function(srna, "calc_normals", "BKE_mesh_calc_normals");
70
83
RNA_def_function_ui_description(func, "Calculate vertex normals");
72
85
func = RNA_def_function(srna, "calc_tessface", "ED_mesh_calc_tessface");
73
86
RNA_def_function_ui_description(func, "Calculate face tessellation (supports editmode too)");
88
func = RNA_def_function(srna, "calc_smooth_groups", "rna_Mesh_calc_smooth_groups");
89
RNA_def_function_ui_description(func, "Calculate smooth groups from sharp edges");
91
parm = RNA_def_int_array(func, "poly_groups", 1, NULL, 0, 0, "", "Smooth Groups", 0, 0);
92
RNA_def_property_flag(parm, PROP_DYNAMIC | PROP_OUTPUT);
93
parm = RNA_def_int(func, "groups", 0, 0, INT_MAX, "groups", "Total number of groups", 0, INT_MAX);
94
RNA_def_property_flag(parm, PROP_OUTPUT);
75
97
func = RNA_def_function(srna, "update", "ED_mesh_update");
76
98
RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
77
99
RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces");