removed all those nasty enums from the operator api. yay! I'm
[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         "connectverts",
8         {{BMOP_OPSLOT_ELEMENT_BUF, "verts"},
9         {BMOP_OPSLOT_ELEMENT_BUF, "edgeout"},
10         {0} /*null-terminating sentinel*/},
11         connectverts_exec,
12         0
13 };
14
15 BMOpDefine def_extrudefaceregion = {
16         "extrudefaceregion",
17         {{BMOP_OPSLOT_ELEMENT_BUF, "edgefacein"},
18         {BMOP_OPSLOT_MAPPING, "exclude"},
19         {BMOP_OPSLOT_ELEMENT_BUF, "geomout"},
20         {0} /*null-terminating sentinel*/},
21         extrude_edge_context_exec,
22         0
23 };
24
25 BMOpDefine def_makefgonsop = {
26         "makefgon",
27         {{0} /*null-terminating sentinel*/},
28         bmesh_make_fgons_exec,
29         0
30 };
31
32 BMOpDefine def_dissolvevertsop = {
33         "dissolveverts",
34         {{BMOP_OPSLOT_ELEMENT_BUF, "verts"},
35         {0} /*null-terminating sentinel*/},
36         dissolveverts_exec,
37         0
38 };
39
40 BMOpDefine def_dissolvefacesop = {
41         "dissolvefaces",
42         {{BMOP_OPSLOT_ELEMENT_BUF, "faces"},
43         {BMOP_OPSLOT_ELEMENT_BUF, "regionout"},
44         {0} /*null-terminating sentinel*/},
45         dissolvefaces_exec,
46         0
47 };
48
49
50 BMOpDefine def_triangop = {
51         "triangulate",
52         {{BMOP_OPSLOT_ELEMENT_BUF, "faces"},
53         {BMOP_OPSLOT_ELEMENT_BUF, "edgeout"},
54         {BMOP_OPSLOT_ELEMENT_BUF, "faceout"},
55         {BMOP_OPSLOT_MAPPING, "facemap"},
56         {0} /*null-terminating sentinel*/},
57         triangulate_exec,
58         0
59 };
60
61 BMOpDefine def_subdop = {
62         "esubd",
63         {{BMOP_OPSLOT_ELEMENT_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         
70         /*these next two can have multiple types of elements in them.*/
71         {BMOP_OPSLOT_ELEMENT_BUF, "outinner"},
72         {BMOP_OPSLOT_ELEMENT_BUF, "outsplit"},
73         {0} /*null-terminating sentinel*/,
74         },
75         esubdivide_exec,
76         0
77 };
78
79 BMOpDefine def_edit2bmesh = {
80         "editmesh_to_bmesh",
81         {{BMOP_OPSLOT_PNT, "em"}, {BMOP_OPSLOT_MAPPING, "map"},
82         {0} /*null-terminating sentinel*/},
83         edit2bmesh_exec,
84         0
85 };
86
87 BMOpDefine def_bmesh2edit = {
88         "bmesh_to_editmesh",
89         {{BMOP_OPSLOT_PNT, "emout"},
90         {0} /*null-terminating sentinel*/},
91         bmesh2edit_exec,
92         0
93 };
94
95 BMOpDefine def_delop = {
96         "del",
97         {{BMOP_OPSLOT_ELEMENT_BUF, "geom"}, {BMOP_OPSLOT_INT, "context"},
98         {0} /*null-terminating sentinel*/},
99         delop_exec,
100         0
101 };
102
103 BMOpDefine def_dupeop = {
104         "dupe",
105         {{BMOP_OPSLOT_ELEMENT_BUF, "geom"},
106         {BMOP_OPSLOT_ELEMENT_BUF, "origout"},
107         {BMOP_OPSLOT_ELEMENT_BUF, "newout"},
108         {BMOP_OPSLOT_MAPPING, "boundarymap"},
109         {BMOP_OPSLOT_MAPPING, "isovertmap"},
110         {0} /*null-terminating sentinel*/},
111         dupeop_exec,
112         0
113 };
114
115 BMOpDefine def_splitop = {
116         "split",
117         {{BMOP_OPSLOT_ELEMENT_BUF, "geom"},
118         {BMOP_OPSLOT_ELEMENT_BUF, "geomout"},
119         {BMOP_OPSLOT_MAPPING, "boundarymap"},
120         {BMOP_OPSLOT_MAPPING, "isovertmap"},
121         {0} /*null-terminating sentinel*/},
122         splitop_exec,
123         0
124 };
125
126 BMOpDefine *opdefines[] = {
127         &def_splitop,
128         &def_dupeop,
129         &def_delop,
130         &def_edit2bmesh,
131         &def_bmesh2edit,
132         &def_subdop,
133         &def_triangop,
134         &def_dissolvefacesop,
135         &def_dissolvevertsop,
136         &def_makefgonsop,
137         &def_extrudefaceregion,
138         &def_connectverts,
139 };
140
141 int bmesh_total_ops = (sizeof(opdefines) / sizeof(void*));