28cf5d881c80dd5b69a446b0224733d5be8d825c
[blender.git] / source / blender / bmesh / intern / bmesh_opdefines.c
1 #include "bmesh.h"
2 #include "bmesh_private.h"
3
4 #include <stdio.h>
5
6 BMOpDefine def_connectverts = {
7         "connectvert",
8         {{BMOP_OPSLOT_PNT_BUF, "verts"},
9         {BMOP_OPSLOT_PNT_BUF, "edgeout"}},
10         connectverts_exec,
11         BM_CONVERTS_TOTSLOT,
12         0
13 };
14
15 BMOpDefine def_extrudefaceregion = {
16         "extrudefaceregion",
17         {{BMOP_OPSLOT_PNT_BUF, "edgefacein"},
18         {BMOP_OPSLOT_MAPPING, "exclude"},
19         {BMOP_OPSLOT_PNT_BUF, "geomout"}},
20         extrude_edge_context_exec,
21         BMOP_EXFACE_TOTSLOT,
22         0
23 };
24
25 BMOpDefine def_makefgonsop = {
26         "makefgon",
27         {0},
28         bmesh_make_fgons_exec,
29         BMOP_MAKE_FGONS_TOTSLOT,
30         0
31 };
32
33 BMOpDefine def_dissolvevertsop = {
34         "dissolveverts",
35         {{BMOP_OPSLOT_PNT_BUF, "verts"}},
36         dissolveverts_exec,
37         BMOP_DISVERTS_TOTSLOT,
38         0
39 };
40
41 BMOpDefine def_dissolvefacesop = {
42         "dissolvefaces",
43         {{BMOP_OPSLOT_PNT_BUF, "faces"},
44         {BMOP_OPSLOT_PNT_BUF, "regionnout"}},
45         dissolvefaces_exec,
46         BMOP_DISFACES_TOTSLOT,
47         0
48 };
49
50
51 BMOpDefine def_triangop = {
52         "triangulate",
53         {{BMOP_OPSLOT_PNT_BUF, "faces"},
54         {BMOP_OPSLOT_PNT_BUF, "edgeout"},
55         {BMOP_OPSLOT_PNT_BUF, "faceout"}},
56         triangulate_exec,
57         BMOP_TRIANG_TOTSLOT,
58         0
59 };
60
61 BMOpDefine def_subdop = {
62         "esubd",
63         {{BMOP_OPSLOT_PNT_BUF, "edges"},
64         {BMOP_OPSLOT_INT, "numcuts"},
65         {BMOP_OPSLOT_INT, "flag"},
66         {BMOP_OPSLOT_FLT, "radius"},
67         {BMOP_OPSLOT_MAPPING, "custompatterns"},
68         {BMOP_OPSLOT_MAPPING, "edgepercents"},
69         {BMOP_OPSLOT_PNT_BUF, "outinner"},
70         {BMOP_OPSLOT_PNT_BUF, "outsplit"},
71         },
72         esubdivide_exec,
73         BMOP_ESUBDIVIDE_TOTSLOT,
74         0
75 };
76
77 BMOpDefine def_edit2bmesh = {
78         "editmesh_to_bmesh",
79         {{BMOP_OPSLOT_PNT, "emout"}},
80         edit2bmesh_exec,
81         BMOP_TO_EDITMESH_TOTSLOT,
82         0
83 };
84
85 BMOpDefine def_bmesh2edit = {
86         "bmesh_to_editmesh",
87         {{BMOP_OPSLOT_PNT, "em"}},
88         bmesh2edit_exec,
89         BMOP_FROM_EDITMESH_TOTSLOT,
90         0
91 };
92
93 BMOpDefine def_delop = {
94         "del",
95         {{BMOP_OPSLOT_PNT_BUF, "geom"}, {BMOP_OPSLOT_INT, "context"}},
96         delop_exec,
97         BMOP_DEL_TOTSLOT,
98         0
99 };
100
101 BMOpDefine def_dupeop = {
102         "dupe",
103         {{BMOP_OPSLOT_PNT_BUF, "geom"},
104         {BMOP_OPSLOT_PNT_BUF, "origout"},
105         {BMOP_OPSLOT_PNT_BUF, "newout"},
106         {BMOP_OPSLOT_MAPPING, "boundarymap"}},
107         dupeop_exec,
108         BMOP_DUPE_TOTSLOT,
109         0
110 };
111
112 BMOpDefine def_splitop = {
113         "split",
114         {{BMOP_OPSLOT_PNT_BUF, "geom"},
115         {BMOP_OPSLOT_PNT_BUF, "geomout"},
116         {BMOP_OPSLOT_MAPPING, "boundarymap"}},
117         splitop_exec,
118         BMOP_SPLIT_TOTSLOT,
119         0
120 };
121
122 BMOpDefine *opdefines[] = {
123         &def_splitop,
124         &def_dupeop,
125         &def_delop,
126         &def_edit2bmesh,
127         &def_bmesh2edit,
128         &def_subdop,
129         &def_triangop,
130         &def_dissolvefacesop,
131         &def_dissolvevertsop,
132         &def_makefgonsop,
133         &def_extrudefaceregion,
134         &def_connectverts,
135 };
136
137 int bmesh_total_ops = (sizeof(opdefines) / sizeof(void*));