~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/makesrna/intern/rna_mesh_api.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
#include "RNA_define.h"
36
36
 
37
 
#include "BLO_sys_types.h"
 
37
#include "BLI_sys_types.h"
38
38
 
39
39
#include "BLI_utildefines.h"
40
40
 
44
44
#include "rna_internal.h"  /* own include */
45
45
 
46
46
#ifdef RNA_RUNTIME
 
47
 
 
48
#include "DNA_mesh_types.h"
 
49
 
47
50
static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2)
48
51
{
49
52
        const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60);
54
57
        return ret;
55
58
}
56
59
 
 
60
void rna_Mesh_calc_smooth_groups(struct Mesh *mesh, int *r_poly_group_len, int **r_poly_group, int *r_group_total)
 
61
{
 
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,
 
67
                            r_group_total);
 
68
}
 
69
 
57
70
#else
58
71
 
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);
68
81
 
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");
71
84
 
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)");
74
87
 
 
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");
 
90
        /* return values */
 
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);
 
95
 
 
96
 
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");