Blender V4.3
bmesh_opdefines.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
38#include "BLI_utildefines.h"
39
40#include "bmesh.hh"
42
43#include "DNA_modifier_types.h"
44
81/* Keep struct definition from wrapping. */
82/* clang-format off */
83
84/* enums shared between multiple operators */
85
87 {0, "X"},
88 {1, "Y"},
89 {2, "Z"},
90 {0, nullptr},
91};
92
94 {0, "-X"},
95 {1, "-Y"},
96 {2, "-Z"},
97 {3, "X"},
98 {4, "Y"},
99 {5, "Z"},
100 {0, nullptr},
101};
102
104 {SUBD_FALLOFF_SMOOTH, "SMOOTH"},
105 {SUBD_FALLOFF_SPHERE, "SPHERE"},
106 {SUBD_FALLOFF_ROOT, "ROOT"},
107 {SUBD_FALLOFF_SHARP, "SHARP"},
108 {SUBD_FALLOFF_LIN, "LINEAR"},
109 {SUBD_FALLOFF_INVSQUARE, "INVERSE_SQUARE"},
110 {0, nullptr},
111};
112
115 value.ptr = ptr;
116 return value;
117}
118
121 value.map = map;
122 return value;
123}
124
127 value.intg = intg;
128 return value;
129}
130
131/* Quiet 'enum-conversion' warning. */
132#define BM_FACE ((eBMOpSlotSubType_Elem)BM_FACE)
133#define BM_EDGE ((eBMOpSlotSubType_Elem)BM_EDGE)
134#define BM_VERT ((eBMOpSlotSubType_Elem)BM_VERT)
135
136/*
137 * Vertex Smooth.
138 *
139 * Smooths vertices by using a basic vertex averaging scheme.
140 */
142 "smooth_vert",
143 /*slot_types_in*/
144 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
145 {"factor", BMO_OP_SLOT_FLT}, /* smoothing factor */
146 {"mirror_clip_x", BMO_OP_SLOT_BOOL}, /* set vertices close to the x axis before the operation to 0 */
147 {"mirror_clip_y", BMO_OP_SLOT_BOOL}, /* set vertices close to the y axis before the operation to 0 */
148 {"mirror_clip_z", BMO_OP_SLOT_BOOL}, /* set vertices close to the z axis before the operation to 0 */
149 {"clip_dist", BMO_OP_SLOT_FLT}, /* clipping threshold for the above three slots */
150 {"use_axis_x", BMO_OP_SLOT_BOOL}, /* smooth vertices along X axis */
151 {"use_axis_y", BMO_OP_SLOT_BOOL}, /* smooth vertices along Y axis */
152 {"use_axis_z", BMO_OP_SLOT_BOOL}, /* smooth vertices along Z axis */
153 {{'\0'}},
154 },
155 {{{'\0'}}}, /* no output */
158};
159
160/*
161 * Vertex Smooth Laplacian.
162 *
163 * Smooths vertices by using Laplacian smoothing propose by.
164 * Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow.
165 */
167 "smooth_laplacian_vert",
168 /*slot_types_in*/
169 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
170 {"lambda_factor", BMO_OP_SLOT_FLT}, /* lambda param */
171 {"lambda_border", BMO_OP_SLOT_FLT}, /* lambda param in border */
172 {"use_x", BMO_OP_SLOT_BOOL}, /* Smooth object along X axis */
173 {"use_y", BMO_OP_SLOT_BOOL}, /* Smooth object along Y axis */
174 {"use_z", BMO_OP_SLOT_BOOL}, /* Smooth object along Z axis */
175 {"preserve_volume", BMO_OP_SLOT_BOOL}, /* Apply volume preservation after smooth */
176 {{'\0'}},
177 },
178 {{{'\0'}}}, /* no output */
181};
182
183/*
184 * Right-Hand Faces.
185 *
186 * Computes an "outside" normal for the specified input faces.
187 */
189 "recalc_face_normals",
190 /*slot_types_in*/
191 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
192 {{'\0'}},
193 },
194 {{{'\0'}}}, /* no output */
198};
199
200/*
201 * Planar Faces.
202 *
203 * Iteratively flatten faces.
204 */
206 "planar_faces",
207 /*slot_types_in*/
208 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input geometry. */
209 {"iterations", BMO_OP_SLOT_INT}, /* Number of times to flatten faces (for when connected faces are used) */
210 {"factor", BMO_OP_SLOT_FLT}, /* Influence for making planar each iteration */
211 {{'\0'}},
212 },
213 /*slot_types_out*/
214 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output slot, computed boundary geometry. */
215 {{'\0'}},
216 },
220};
221
222/*
223 * Region Extend.
224 *
225 * used to implement the select more/less tools.
226 * this puts some geometry surrounding regions of
227 * geometry in geom into geom.out.
228 *
229 * if use_faces is 0 then geom.out spits out verts and edges,
230 * otherwise it spits out faces.
231 */
233 "region_extend",
234 /*slot_types_in*/
235 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
236 {"use_contract", BMO_OP_SLOT_BOOL}, /* find boundary inside the regions, not outside. */
237 {"use_faces", BMO_OP_SLOT_BOOL}, /* extend from faces instead of edges */
238 {"use_face_step", BMO_OP_SLOT_BOOL}, /* step over connected faces */
239 {{'\0'}},
240 },
241 /*slot_types_out*/
242 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output slot, computed boundary geometry. */
243 {{'\0'}},
244 },
248};
249
250/*
251 * Edge Rotate.
252 *
253 * Rotates edges topologically. Also known as "spin edge" to some people.
254 * Simple example: `[/] becomes [|] then [\]`.
255 */
257 "rotate_edges",
258 /*slot_types_in*/
259 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
260 {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate edge counter-clockwise if true, otherwise clockwise */
261 {{'\0'}},
262 },
263 /*slot_types_out*/
264 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* newly spun edges */
265 {{'\0'}},
266 },
272};
273
274/*
275 * Reverse Faces.
276 *
277 * Reverses the winding (vertex order) of faces.
278 * This has the effect of flipping the normal.
279 */
281 "reverse_faces",
282 /*slot_types_in*/
283 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
284 {"flip_multires", BMO_OP_SLOT_BOOL}, /* maintain multi-res offset */
285 {{'\0'}},
286 },
287 {{{'\0'}}}, /* no output */
291};
292
293/*
294 * Flip Quad Tessellation
295 *
296 * Flip the tessellation direction of the selected quads.
297 */
299 "flip_quad_tessellation",
300 /* slot_in */
301 {
302 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
303 {{'\0'}}
304 },
305 {{{'\0'}}}, /* no output */
308};
309
310/*
311 * Edge Bisect.
312 *
313 * Splits input edges (but doesn't do anything else).
314 * This creates a 2-valence vert.
315 */
317 "bisect_edges",
318 /*slot_types_in*/
319 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
320 {"cuts", BMO_OP_SLOT_INT}, /* number of cuts */
322 {{'\0'}},
323 },
324 /*slot_types_out*/
325 {{"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* newly created vertices and edges */
326 {{'\0'}},
327 },
333};
334
335/*
336 * Mirror.
337 *
338 * Mirrors geometry along an axis. The resulting geometry is welded on using
339 * merge_dist. Pairs of original/mirrored vertices are welded using the merge_dist
340 * parameter (which defines the minimum distance for welding to happen).
341 */
343 "mirror",
344 /*slot_types_in*/
345 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
346 {"matrix", BMO_OP_SLOT_MAT}, /* matrix defining the mirror transformation */
347 {"merge_dist", BMO_OP_SLOT_FLT}, /* maximum distance for merging. does no merging if 0. */
349 {"mirror_u", BMO_OP_SLOT_BOOL}, /* mirror UVs across the u axis */
350 {"mirror_v", BMO_OP_SLOT_BOOL}, /* mirror UVs across the v axis */
351 {"mirror_udim", BMO_OP_SLOT_BOOL}, /* mirror UVs in each tile */
352 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
353 {{'\0'}},
354 },
355 /*slot_types_out*/
356 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output geometry, mirrored */
357 {{'\0'}},
358 },
363};
364
365/*
366 * Find Doubles.
367 *
368 * Takes input verts and find vertices they should weld to.
369 * Outputs a mapping slot suitable for use with the weld verts BMOP.
370 *
371 * If keep_verts is used, vertices outside that set can only be merged
372 * with vertices in that set.
373 */
375 "find_doubles",
376 /*slot_types_in*/
377 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
378 {"keep_verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* list of verts to keep */
379 {"dist", BMO_OP_SLOT_FLT}, /* maximum distance */
380 {{'\0'}},
381 },
382 /*slot_types_out*/
384 {{'\0'}},
385 },
388};
389
390/*
391 * Remove Doubles.
392 *
393 * Finds groups of vertices closer than dist and merges them together,
394 * using the weld verts BMOP.
395 */
397 "remove_doubles",
398 /*slot_types_in*/
399 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input verts */
400 {"dist", BMO_OP_SLOT_FLT}, /* minimum distance */
401 {{'\0'}},
402 },
403 {{{'\0'}}}, /* no output */
409};
410
411/*
412 * Collapse Connected.
413 *
414 * Collapses connected vertices
415 */
417 "collapse",
418 /*slot_types_in*/
419 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
420 {"uvs", BMO_OP_SLOT_BOOL}, /* also collapse UVs and such */
421 {{'\0'}},
422 },
423 {{{'\0'}}}, /* no output */
429};
430
431/*
432 * Face-Data Point Merge.
433 *
434 * Merge uv/vcols at a specific vertex.
435 */
437 "pointmerge_facedata",
438 /*slot_types_in*/
439 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
440 {"vert_snap", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE}}, /* snap vertex */
441 {{'\0'}},
442 },
443 {{{'\0'}}}, /* no output */
446};
447
448/*
449 * Average Vertices Face-vert Data.
450 *
451 * Merge uv/vcols associated with the input vertices at
452 * the bounding box center. (I know, it's not averaging but
453 * the vert_snap_to_bb_center is just too long).
454 */
456 "average_vert_facedata",
457 /*slot_types_in*/
458 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
459 {{'\0'}},
460 },
461 {{{'\0'}}}, /* no output */
464};
465
466/*
467 * Point Merge.
468 *
469 * Merge verts together at a point.
470 */
472 "pointmerge",
473 /*slot_types_in*/
474 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices (all verts will be merged into the first). */
475 {"merge_co", BMO_OP_SLOT_VEC}, /* Position to merge at. */
476 {{'\0'}},
477 },
478 {{{'\0'}}}, /* no output */
484};
485
486/*
487 * Collapse Connected UVs.
488 *
489 * Collapses connected UV vertices.
490 */
492 "collapse_uvs",
493 /*slot_types_in*/
494 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
495 {{'\0'}},
496 },
497 {{{'\0'}}}, /* no output */
500};
501
502/*
503 * Weld Verts.
504 *
505 * Welds verts together (kind-of like remove doubles, merge, etc, all of which
506 * use or will use this BMOP). You pass in mappings from vertices to the vertices
507 * they weld with.
508 */
510 "weld_verts",
511 /*slot_types_in*/
512 {{"targetmap", BMO_OP_SLOT_MAPPING, {eBMOpSlotSubType_Elem(BMO_OP_SLOT_SUBTYPE_MAP_ELEM)}}, /* maps welded vertices to verts they should weld to */
513 {{'\0'}},
514 },
515 {{{'\0'}}}, /* no output */
521};
522
523/*
524 * Make Vertex.
525 *
526 * Creates a single vertex; this BMOP was necessary
527 * for click-create-vertex.
528 */
530 "create_vert",
531 /*slot_types_in*/
532 {{"co", BMO_OP_SLOT_VEC}, /* the coordinate of the new vert */
533 {{'\0'}},
534 },
535 /*slot_types_out*/
536 {{"vert.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* the new vert */
537 {{'\0'}},
538 },
541};
542
543/*
544 * Join Triangles.
545 *
546 * Tries to intelligently join triangles according
547 * to angle threshold and delimiters.
548 */
550 "join_triangles",
551 /*slot_types_in*/
552 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input geometry. */
553 {"cmp_seam", BMO_OP_SLOT_BOOL}, /* Compare seam */
554 {"cmp_sharp", BMO_OP_SLOT_BOOL}, /* Compare sharp */
555 {"cmp_uvs", BMO_OP_SLOT_BOOL}, /* Compare UVs */
556 {"cmp_vcols", BMO_OP_SLOT_BOOL}, /* compare VCols */
557 {"cmp_materials", BMO_OP_SLOT_BOOL}, /* compare materials */
558 {"angle_face_threshold", BMO_OP_SLOT_FLT},
559 {"angle_shape_threshold", BMO_OP_SLOT_FLT},
560 {{'\0'}},
561 },
562 /*slot_types_out*/
563 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* joined faces */
564 {{'\0'}},
565 },
571};
572
573/*
574 * Contextual Create.
575 *
576 * This is basically F-key, it creates
577 * new faces from vertices, makes stuff from edge nets,
578 * makes wire edges, etc. It also dissolves faces.
579 *
580 * Three verts become a triangle, four become a quad. Two
581 * become a wire edge.
582 */
584 "contextual_create",
585 /*slot_types_in*/
586 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry. */
587 {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */
588 {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth to use */
589 {{'\0'}},
590 },
591 /*slot_types_out*/
592 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* newly-made face(s) */
593 /* NOTE: this is for stand-alone edges only, not edges which are a part of newly created faces. */
594 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* newly-made edge(s) */
595 {{'\0'}},
596 },
602};
603
604/*
605 * Bridge edge loops with faces.
606 */
608 "bridge_loops",
609 /*slot_types_in*/
610 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
611 {"use_pairs", BMO_OP_SLOT_BOOL},
612 {"use_cyclic", BMO_OP_SLOT_BOOL},
613 {"use_merge", BMO_OP_SLOT_BOOL}, /* merge rather than creating faces */
614 {"merge_factor", BMO_OP_SLOT_FLT}, /* merge factor */
615 {"twist_offset", BMO_OP_SLOT_INT}, /* twist offset for closed loops */
616 {{'\0'}},
617 },
618 /*slot_types_out*/
619 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */
620 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* new edges */
621 {{'\0'}},
622 },
627};
628
629/*
630 * Grid Fill.
631 *
632 * Create faces defined by 2 disconnected edge loops (which share edges).
633 */
635 "grid_fill",
636 /*slot_types_in*/
637 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
638 /* restricts edges to groups. maps edges to integer */
639 {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */
640 {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */
641 {"use_interp_simple", BMO_OP_SLOT_BOOL}, /* use simple interpolation */
642 {{'\0'}},
643 },
644 /*slot_types_out*/
645 /* maps new faces to the group numbers they came from */
646 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */
647 {{'\0'}},
648 },
652};
653
654
655/*
656 * Fill Holes.
657 *
658 * Fill boundary edges with faces, copying surrounding customdata.
659 */
661 "holes_fill",
662 /*slot_types_in*/
663 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
664 {"sides", BMO_OP_SLOT_INT}, /* number of face sides to fill */
665 {{'\0'}},
666 },
667 /*slot_types_out*/
668 /* maps new faces to the group numbers they came from */
669 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */
670 {{'\0'}},
671 },
675};
676
677
678/*
679 * Face Attribute Fill.
680 *
681 * Fill in faces with data from adjacent faces.
682 */
684 "face_attribute_fill",
685 /*slot_types_in*/
686 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
687 {"use_normals", BMO_OP_SLOT_BOOL}, /* copy face winding */
688 {"use_data", BMO_OP_SLOT_BOOL}, /* copy face data */
689 {{'\0'}},
690 },
691 /*slot_types_out*/
692 /* maps new faces to the group numbers they came from */
693 {{"faces_fail.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* faces that could not be handled */
694 {{'\0'}},
695 },
698};
699
700/*
701 * Edge Loop Fill.
702 *
703 * Create faces defined by one or more non overlapping edge loops.
704 */
706 "edgeloop_fill",
707 /*slot_types_in*/
708 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
709 /* restricts edges to groups. maps edges to integer */
710 {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */
711 {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */
712 {{'\0'}},
713 },
714 /*slot_types_out*/
715 /* maps new faces to the group numbers they came from */
716 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */
717 {{'\0'}},
718 },
722};
723
724
725/*
726 * Edge Net Fill.
727 *
728 * Create faces defined by enclosed edges.
729 */
731 "edgenet_fill",
732 /*slot_types_in*/
733 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
734 {"mat_nr", BMO_OP_SLOT_INT}, /* material to use */
735 {"use_smooth", BMO_OP_SLOT_BOOL}, /* smooth state to use */
736 {"sides", BMO_OP_SLOT_INT}, /* number of sides */
737 {{'\0'}},
738 },
739 /*slot_types_out*/
740 /* maps new faces to the group numbers they came from */
741 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new faces */
742 {{'\0'}},
743 },
747};
748
749/*
750 * Edge-net Prepare.
751 *
752 * Identifies several useful edge loop cases and modifies them so
753 * they'll become a face when edgenet_fill is called. The cases covered are:
754 *
755 * - One single loop; an edge is added to connect the ends
756 * - Two loops; two edges are added to connect the endpoints (based on the
757 * shortest distance between each endpoint).
758 */
760 "edgenet_prepare",
761 /*slot_types_in*/
762 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
763 {{'\0'}},
764 },
765 /*slot_types_out*/
766 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* new edges */
767 {{'\0'}},
768 },
771};
772
773/*
774 * Rotate.
775 *
776 * Rotate vertices around a center, using a 3x3 rotation matrix.
777 */
779 "rotate",
780 /*slot_types_in*/
781 {{"cent", BMO_OP_SLOT_VEC}, /* center of rotation */
782 {"matrix", BMO_OP_SLOT_MAT}, /* matrix defining rotation */
783 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
784 {"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
785 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
786 {{'\0'}},
787 },
788 {{{'\0'}}}, /* no output */
791};
792
793/*
794 * Translate.
795 *
796 * Translate vertices by an offset.
797 */
799 "translate",
800 /*slot_types_in*/
801 {{"vec", BMO_OP_SLOT_VEC}, /* translation offset */
802 {"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
803 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
804 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
805 {{'\0'}},
806 },
807 {{{'\0'}}}, /* no output */
810};
811
812/*
813 * Scale.
814 *
815 * Scales vertices by an offset.
816 */
818 "scale",
819 /*slot_types_in*/
820 {{"vec", BMO_OP_SLOT_VEC}, /* scale factor */
821 {"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
822 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
823 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
824 {{'\0'}},
825 },
826 {{{'\0'}}}, /* no output */
829};
830
831
832/*
833 * Transform.
834 *
835 * Transforms a set of vertices by a matrix. Multiplies
836 * the vertex coordinates with the matrix.
837 */
839 "transform",
840 /*slot_types_in*/
841 {{"matrix", BMO_OP_SLOT_MAT}, /* transform matrix */
842 {"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
843 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
844 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
845 {{'\0'}},
846 },
847 {{{'\0'}}}, /* no output */
850};
851
852/*
853 * Object Load BMesh.
854 *
855 * Loads a bmesh into an object/mesh. This is a "private"
856 * BMOP.
857 */
859 "object_load_bmesh",
860 /*slot_types_in*/
861 {{"scene", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_SCENE)}, /* pointer to an scene structure */
862 {"object", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_OBJECT)}, /* pointer to an object structure */
863 {{'\0'}},
864 },
865 {{{'\0'}}}, /* no output */
868};
869
870
871/*
872 * BMesh to Mesh.
873 *
874 * Converts a bmesh to a Mesh. This is reserved for exiting editmode.
875 */
877 "bmesh_to_mesh",
878 /*slot_types_in*/
879 {
880 {"mesh", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_MESH)}, /* pointer to a mesh structure to fill in */
881 {"object", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_OBJECT)}, /* pointer to an object structure */
882 {{'\0'}},
883 },
884 {{{'\0'}}}, /* no output */
887};
888
889/*
890 * Mesh to BMesh.
891 *
892 * Load the contents of a mesh into the bmesh. this BMOP is private, it's
893 * reserved exclusively for entering editmode.
894 */
896 "mesh_to_bmesh",
897 /*slot_types_in*/
898 {
899 {"mesh", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_MESH)}, /* pointer to a Mesh structure */
900 {"object", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_OBJECT)}, /* pointer to an Object structure */
901 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* load active shapekey coordinates into verts */
902 {{'\0'}},
903 },
904 {{{'\0'}}}, /* no output */
907};
908
909/*
910 * Individual Face Extrude.
911 *
912 * Extrudes faces individually.
913 */
915 "extrude_discrete_faces",
916 /*slot_types_in*/
917 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
918 {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
919 {"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
920 {{'\0'}},
921 },
922 /*slot_types_out*/
923 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
924 {{'\0'}},
925 },
928};
929
930/*
931 * Extrude Only Edges.
932 *
933 * Extrudes Edges into faces, note that this is very simple, there's no fancy
934 * winged extrusion.
935 */
937 "extrude_edge_only",
938 /*slot_types_in*/
939 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input vertices */
940 {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
941 {"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
942 {{'\0'}},
943 },
944 /*slot_types_out*/
945 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output geometry */
946 {{'\0'}},
947 },
950};
951
952/*
953 * Individual Vertex Extrude.
954 *
955 * Extrudes wire edges from vertices.
956 */
958 "extrude_vert_indiv",
959 /*slot_types_in*/
960 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
961 {"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
962 {{'\0'}},
963 },
964 /*slot_types_out*/
965 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output wire edges */
966 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output vertices */
967 {{'\0'}},
968 },
971};
972
973/*
974 * Connect Verts.
975 *
976 * Split faces by adding edges that connect **verts**.
977 */
979 "connect_verts",
980 /*slot_types_in*/
981 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
982 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces to explicitly exclude from connecting */
983 {"check_degenerate", BMO_OP_SLOT_BOOL}, /* prevent splits with overlaps & intersections */
984 {{'\0'}},
985 },
986 /*slot_types_out*/
987 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
988 {{'\0'}},
989 },
994};
995
996/*
997 * Connect Verts to form Convex Faces.
998 *
999 * Ensures all faces are convex **faces**.
1000 */
1002 "connect_verts_concave",
1003 /*slot_types_in*/
1004 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1005 {{'\0'}},
1006 },
1007 /*slot_types_out*/
1008 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1009 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1010 {{'\0'}},
1011 },
1016};
1017
1018/*
1019 * Connect Verts Across non Planer Faces.
1020 *
1021 * Split faces by connecting edges along non planer **faces**.
1022 */
1024 "connect_verts_nonplanar",
1025 /*slot_types_in*/
1026 {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
1027 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1028 {{'\0'}},
1029 },
1030 /*slot_types_out*/
1031 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1032 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1033 {{'\0'}},
1034 },
1039};
1040
1041/*
1042 * Connect Verts.
1043 *
1044 * Split faces by adding edges that connect **verts**.
1045 */
1047 "connect_vert_pair",
1048 /*slot_types_in*/
1049 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
1050 {"verts_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices to explicitly exclude from connecting */
1051 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces to explicitly exclude from connecting */
1052 {{'\0'}},
1053 },
1054 /*slot_types_out*/
1055 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1056 {{'\0'}},
1057 },
1062};
1063
1064
1065/*
1066 * Extrude Faces.
1067 *
1068 * Extrude operator (does not transform)
1069 */
1071 "extrude_face_region",
1072 /*slot_types_in*/
1073 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* edges and faces */
1074 {"edges_exclude", BMO_OP_SLOT_MAPPING, to_subtype_union(BMO_OP_SLOT_SUBTYPE_MAP_EMPTY)}, /* input edges to explicitly exclude from extrusion */
1075 {"use_keep_orig", BMO_OP_SLOT_BOOL}, /* keep original geometry (requires ``geom`` to include edges). */
1076 {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
1077 {"use_normal_from_adjacent", BMO_OP_SLOT_BOOL}, /* Use winding from surrounding faces instead of this region. */
1078 {"use_dissolve_ortho_edges", BMO_OP_SLOT_BOOL}, /* Dissolve edges whose faces form a flat surface. */
1079 {"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
1080 {{'\0'}},
1081 },
1082 /*slot_types_out*/
1083 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1084 {{'\0'}},
1085 },
1088};
1089
1090/*
1091 * Dissolve Verts.
1092 */
1094 "dissolve_verts",
1095 /*slot_types_in*/
1096 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
1097 {"use_face_split", BMO_OP_SLOT_BOOL}, /* split off face corners to maintain surrounding geometry */
1098 {"use_boundary_tear", BMO_OP_SLOT_BOOL}, /* split off face corners instead of merging faces */
1099 {{'\0'}},
1100 },
1101 {{{'\0'}}}, /* no output */
1107};
1108
1109/*
1110 * Dissolve Edges.
1111 */
1113 "dissolve_edges",
1114 /*slot_types_in*/
1115 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1116 {"use_verts", BMO_OP_SLOT_BOOL}, /* dissolve verts left between only 2 edges. */
1117 {"use_face_split", BMO_OP_SLOT_BOOL}, /* split off face corners to maintain surrounding geometry */
1118 {{'\0'}},
1119 },
1120 /*slot_types_out*/
1121 {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1122 {{'\0'}},
1123 },
1129};
1130
1131/*
1132 * Dissolve Faces.
1133 */
1135 "dissolve_faces",
1136 /*slot_types_in*/
1137 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1138 {"use_verts", BMO_OP_SLOT_BOOL}, /* dissolve verts left between only 2 edges. */
1139 {{'\0'}},
1140 },
1141 /*slot_types_out*/
1142 {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1143 {{'\0'}},
1144 },
1150};
1151
1153 {BMO_DELIM_NORMAL, "NORMAL"},
1154 {BMO_DELIM_MATERIAL, "MATERIAL"},
1155 {BMO_DELIM_SEAM, "SEAM"},
1156 {BMO_DELIM_SHARP, "SHARP"},
1157 {BMO_DELIM_UV, "UV"},
1158 {0, nullptr},
1159};
1160
1161/*
1162 * Limited Dissolve.
1163 *
1164 * Dissolve planar faces and co-linear edges.
1165 */
1167 "dissolve_limit",
1168 /*slot_types_in*/
1169 {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
1170 {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL}, /* dissolve all vertices in between face boundaries */
1171 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
1172 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1173 {"delimit", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_FLAG), bmo_enum_dissolve_limit_flags}, /* delimit dissolve operation */
1174 {{'\0'}},
1175 },
1176 /*slot_types_out*/
1177 {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1178 {{'\0'}}},
1184};
1185
1186/*
1187 * Degenerate Dissolve.
1188 *
1189 * Dissolve edges with no length, faces with no area.
1190 */
1192 "dissolve_degenerate",
1193 /*slot_types_in*/
1194 {{"dist", BMO_OP_SLOT_FLT}, /* maximum distance to consider degenerate */
1195 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1196 {{'\0'}},
1197 },
1198 /*slot_types_out*/
1199 {{{'\0'}}},
1205};
1206
1208 {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY"},
1209 {MOD_TRIANGULATE_QUAD_FIXED, "FIXED"},
1210 {MOD_TRIANGULATE_QUAD_ALTERNATE, "ALTERNATE"},
1211 {MOD_TRIANGULATE_QUAD_SHORTEDGE, "SHORT_EDGE"},
1212 {MOD_TRIANGULATE_QUAD_LONGEDGE, "LONG_EDGE"},
1213 {0, nullptr},
1214};
1215
1217 {MOD_TRIANGULATE_NGON_BEAUTY, "BEAUTY"},
1218 {MOD_TRIANGULATE_NGON_EARCLIP, "EAR_CLIP"},
1219 {0, nullptr},
1220};
1221
1222/*
1223 * Triangulate.
1224 */
1226 "triangulate",
1227 /*slot_types_in*/
1228 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1229 {"quad_method", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_triangulate_quad_method}, /* method for splitting the quads into triangles */
1230 {"ngon_method", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_triangulate_ngon_method}, /* method for splitting the polygons into triangles */
1231 {{'\0'}},
1232 },
1233 /*slot_types_out*/
1234 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1235 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1237 {"face_map_double.out", BMO_OP_SLOT_MAPPING, {eBMOpSlotSubType_Elem(BMO_OP_SLOT_SUBTYPE_MAP_ELEM)}}, /* duplicate faces */
1238 {{'\0'}},
1239 },
1244};
1245
1246/*
1247 * Un-Subdivide.
1248 *
1249 * Reduce detail in geometry containing grids.
1250 */
1252 "unsubdivide",
1253 /*slot_types_in*/
1254 {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
1255 {"iterations", BMO_OP_SLOT_INT}, /* number of times to unsubdivide */
1256 {{'\0'}},
1257 },
1258 {{{'\0'}}}, /* no output */
1264};
1265
1267 {SUBD_CORNER_STRAIGHT_CUT, "STRAIGHT_CUT"},
1268 {SUBD_CORNER_INNERVERT, "INNER_VERT"},
1269 {SUBD_CORNER_PATH, "PATH"},
1270 {SUBD_CORNER_FAN, "FAN"},
1271 {0, nullptr},
1272};
1273
1274/*
1275 * Subdivide Edges.
1276 *
1277 * Advanced operator for subdividing edges
1278 * with options for face patterns, smoothing and randomization.
1279 */
1281 "subdivide_edges",
1282 /*slot_types_in*/
1283 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1284 {"smooth", BMO_OP_SLOT_FLT}, /* smoothness factor */
1285 {"smooth_falloff", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_falloff_type}, /* smooth falloff type */
1286 {"fractal", BMO_OP_SLOT_FLT}, /* fractal randomness factor */
1287 {"along_normal", BMO_OP_SLOT_FLT}, /* apply fractal displacement along normal only */
1288 {"cuts", BMO_OP_SLOT_INT}, /* number of cuts */
1289 {"seed", BMO_OP_SLOT_INT}, /* seed for the random number generator */
1290 {"custom_patterns", BMO_OP_SLOT_MAPPING, to_subtype_union(BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL)}, /* uses custom pointers */
1293 {"use_grid_fill", BMO_OP_SLOT_BOOL}, /* fill in fully-selected faces with a grid */
1294 {"use_single_edge", BMO_OP_SLOT_BOOL}, /* tessellate the case of one edge selected in a quad or triangle */
1295 {"use_only_quads", BMO_OP_SLOT_BOOL}, /* Only subdivide quads (for loop-cut). */
1296 {"use_sphere", BMO_OP_SLOT_BOOL}, /* for making new primitives only */
1297 {"use_smooth_even", BMO_OP_SLOT_BOOL}, /* maintain even offset when smoothing */
1298 {{'\0'}},
1299 },
1300 /*slot_types_out*/
1301 {/* these next three can have multiple types of elements in them */
1302 {"geom_inner.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1303 {"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1304 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* contains all output geometry */
1305 {{'\0'}},
1306 },
1312};
1313
1315 {SUBD_RING_INTERP_LINEAR, "LINEAR"},
1316 {SUBD_RING_INTERP_PATH, "PATH"},
1317 {SUBD_RING_INTERP_SURF, "SURFACE"},
1318 {0, nullptr},
1319};
1320
1321/*
1322 * Subdivide Edge-Ring.
1323 *
1324 * Take an edge-ring, and subdivide with interpolation options.
1325 */
1327 "subdivide_edgering",
1328 /*slot_types_in*/
1329 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input vertices */
1331 {"smooth", BMO_OP_SLOT_FLT}, /* smoothness factor */
1332 {"cuts", BMO_OP_SLOT_INT}, /* number of cuts */
1333 {"profile_shape", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_falloff_type}, /* profile shape type */
1334 {"profile_shape_factor", BMO_OP_SLOT_FLT}, /* how much intermediary new edges are shrunk/expanded */
1335 {{'\0'}},
1336 },
1337 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
1338 {{'\0'}}},
1344};
1345
1346/*
1347 * Bisect Plane.
1348 *
1349 * Bisects the mesh by a plane (cut the mesh in half).
1350 */
1352 "bisect_plane",
1353 /*slot_types_in*/
1354 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1355 {"dist", BMO_OP_SLOT_FLT}, /* minimum distance when testing if a vert is exactly on the plane */
1356 {"plane_co", BMO_OP_SLOT_VEC}, /* point on the plane */
1357 {"plane_no", BMO_OP_SLOT_VEC}, /* direction of the plane */
1358 {"use_snap_center", BMO_OP_SLOT_BOOL}, /* snap axis aligned verts to the center */
1359 {"clear_outer", BMO_OP_SLOT_BOOL}, /* when enabled. remove all geometry on the positive side of the plane */
1360 {"clear_inner", BMO_OP_SLOT_BOOL}, /* when enabled. remove all geometry on the negative side of the plane */
1361 {{'\0'}},
1362 },
1363 {{"geom_cut.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE}}, /* output geometry aligned with the plane (new and existing) */
1364 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input and output geometry (result of cut). */
1365 {{'\0'}}},
1371};
1372
1374 {DEL_VERTS, "VERTS"},
1375 {DEL_EDGES, "EDGES"},
1376 {DEL_ONLYFACES, "FACES_ONLY"},
1377 {DEL_EDGESFACES, "EDGES_FACES"},
1378 {DEL_FACES, "FACES"},
1379 {DEL_FACES_KEEP_BOUNDARY, "FACES_KEEP_BOUNDARY"},
1380 {DEL_ONLYTAGGED, "TAGGED_ONLY"},
1381 {0, nullptr},
1382};
1383
1384/*
1385 * Delete Geometry.
1386 *
1387 * Utility operator to delete geometry.
1388 */
1390 "delete",
1391 /*slot_types_in*/
1392 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1393 {"context", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_delete_context}, /* geometry types to delete */
1394 {{'\0'}},
1395 },
1396 {{{'\0'}}}, /* no output */
1401};
1402
1403/*
1404 * Duplicate Geometry.
1405 *
1406 * Utility operator to duplicate geometry,
1407 * optionally into a destination mesh.
1408 */
1410 "duplicate",
1411 /*slot_types_in*/
1412 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1413 {"dest", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_BMESH)}, /* destination bmesh, if None will use current on */
1414 {"use_select_history", BMO_OP_SLOT_BOOL},
1415 {"use_edge_flip_from_face", BMO_OP_SLOT_BOOL},
1416 {{'\0'}},
1417 },
1418 /*slot_types_out*/
1419 {{"geom_orig.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1420 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1421 /* face_map maps from source faces to dupe
1422 * faces, and from dupe faces to source faces */
1428 {{'\0'}},
1429 },
1433};
1434
1435/*
1436 * Split Off Geometry.
1437 *
1438 * Disconnect geometry from adjacent edges and faces,
1439 * optionally into a destination mesh.
1440 */
1442 "split",
1443 /*slot_types_in*/
1444 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1445 {"dest", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_BMESH)}, /* destination bmesh, if None will use current one */
1446 {"use_only_faces", BMO_OP_SLOT_BOOL}, /* when enabled. don't duplicate loose verts/edges */
1447 {{'\0'}},
1448 },
1449 /*slot_types_out*/
1450 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1453 {{'\0'}},
1454 },
1458};
1459
1460/*
1461 * Spin.
1462 *
1463 * Extrude or duplicate geometry a number of times,
1464 * rotating and possibly translating after each step
1465 */
1467 "spin",
1468 /*slot_types_in*/
1469 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1470 {"cent", BMO_OP_SLOT_VEC}, /* rotation center */
1471 {"axis", BMO_OP_SLOT_VEC}, /* rotation axis */
1472 {"dvec", BMO_OP_SLOT_VEC}, /* translation delta per step */
1473 {"angle", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
1474 {"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
1475 {"steps", BMO_OP_SLOT_INT}, /* number of steps */
1476 {"use_merge", BMO_OP_SLOT_BOOL}, /* Merge first/last when the angle is a full revolution. */
1477 {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
1478 {"use_duplicate", BMO_OP_SLOT_BOOL}, /* duplicate or extrude? */
1479 {{'\0'}},
1480 },
1481 /*slot_types_out*/
1482 {{"geom_last.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* result of last step */
1483 {{'\0'}},
1484 },
1488};
1489
1490/*
1491 * UV Rotation.
1492 *
1493 * Cycle the loop UVs
1494 */
1496 "rotate_uvs",
1497 /*slot_types_in*/
1498 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1499 {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, otherwise clockwise */
1500 {{'\0'}},
1501 },
1502 {{{'\0'}}}, /* no output */
1505};
1506
1507/*
1508 * UV Reverse.
1509 *
1510 * Reverse the UVs
1511 */
1513 "reverse_uvs",
1514 /*slot_types_in*/
1515 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1516 {{'\0'}},
1517 },
1518 {{{'\0'}}}, /* no output */
1521};
1522
1523/*
1524 * Color Rotation.
1525 *
1526 * Cycle the loop colors
1527 */
1529 "rotate_colors",
1530 /*slot_types_in*/
1531 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1532 {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, otherwise clockwise */
1533 {"color_index", BMO_OP_SLOT_INT}, /* index into color attribute list */
1534 {{'\0'}},
1535 },
1536 {{{'\0'}}}, /* no output */
1539};
1540
1541/*
1542 * Color Reverse
1543 *
1544 * Reverse the loop colors.
1545 */
1547 "reverse_colors",
1548 /*slot_types_in*/
1549 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1550 {"color_index", BMO_OP_SLOT_INT}, /* index into color attribute list */
1551 {{'\0'}},
1552 },
1553 {{{'\0'}}}, /* no output */
1556};
1557
1558/*
1559 * Edge Split.
1560 *
1561 * Disconnects faces along input edges.
1562 */
1564 "split_edges",
1565 /*slot_types_in*/
1566 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1567 /* needed for vertex rip so we can rip only half an edge at a boundary which would otherwise split off */
1568 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* optional tag verts, use to have greater control of splits */
1569 {"use_verts", BMO_OP_SLOT_BOOL}, /* use 'verts' for splitting, else just find verts to split from edges */
1570 {{'\0'}},
1571 },
1572 /*slot_types_out*/
1573 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* old output disconnected edges */
1574 {{'\0'}},
1575 },
1580};
1581
1582/*
1583 * Create Grid.
1584 *
1585 * Creates a grid with a variable number of subdivisions
1586 */
1588 "create_grid",
1589 /*slot_types_in*/
1590 {{"x_segments", BMO_OP_SLOT_INT}, /* number of x segments */
1591 {"y_segments", BMO_OP_SLOT_INT}, /* number of y segments */
1592 {"size", BMO_OP_SLOT_FLT}, /* size of the grid */
1593 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1594 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1595 {{'\0'}},
1596 },
1597 /*slot_types_out*/
1598 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1599 {{'\0'}},
1600 },
1604};
1605
1606/*
1607 * Create UV Sphere.
1608 *
1609 * Creates a grid with a variable number of subdivisions
1610 */
1612 "create_uvsphere",
1613 /*slot_types_in*/
1614 {{"u_segments", BMO_OP_SLOT_INT}, /* number of u segments */
1615 {"v_segments", BMO_OP_SLOT_INT}, /* number of v segment */
1616 {"radius", BMO_OP_SLOT_FLT}, /* radius */
1617 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1618 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1619 {{'\0'}},
1620 },
1621 /*slot_types_out*/
1622 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1623 {{'\0'}},
1624 },
1628};
1629
1630/*
1631 * Create Ico-Sphere.
1632 *
1633 * Creates a grid with a variable number of subdivisions
1634 */
1636 "create_icosphere",
1637 /*slot_types_in*/
1638 {{"subdivisions", BMO_OP_SLOT_INT}, /* how many times to recursively subdivide the sphere */
1639 {"radius", BMO_OP_SLOT_FLT}, /* radius */
1640 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1641 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1642 {{'\0'}},
1643 },
1644 /*slot_types_out*/
1645 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1646 {{'\0'}},
1647 },
1651};
1652
1653/*
1654 * Create Suzanne.
1655 *
1656 * Creates a monkey (standard blender primitive).
1657 */
1659 "create_monkey",
1660 /*slot_types_in*/
1661 {{"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1662 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1663 {{'\0'}},
1664 },
1665 /*slot_types_out*/
1666 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1667 {{'\0'}},
1668 },
1672};
1673
1674/*
1675 * Create Cone.
1676 *
1677 * Creates a cone with variable depth at both ends
1678 */
1680 "create_cone",
1681 /*slot_types_in*/
1682 {{"cap_ends", BMO_OP_SLOT_BOOL}, /* whether or not to fill in the ends with faces */
1683 {"cap_tris", BMO_OP_SLOT_BOOL}, /* fill ends with triangles instead of ngons */
1684 {"segments", BMO_OP_SLOT_INT}, /* number of vertices in the base circle */
1685 {"radius1", BMO_OP_SLOT_FLT}, /* radius of one end */
1686 {"radius2", BMO_OP_SLOT_FLT}, /* radius of the opposite */
1687 {"depth", BMO_OP_SLOT_FLT}, /* distance between ends */
1688 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1689 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1690 {{'\0'}},
1691 },
1692 /*slot_types_out*/
1693 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1694 {{'\0'}},
1695 },
1699};
1700
1701/*
1702 * Creates a Circle.
1703 */
1705 "create_circle",
1706 /*slot_types_in*/
1707 {{"cap_ends", BMO_OP_SLOT_BOOL}, /* whether or not to fill in the ends with faces */
1708 {"cap_tris", BMO_OP_SLOT_BOOL}, /* fill ends with triangles instead of ngons */
1709 {"segments", BMO_OP_SLOT_INT}, /* number of vertices in the circle */
1710 {"radius", BMO_OP_SLOT_FLT}, /* Radius of the circle. */
1711 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1712 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1713 {{'\0'}},
1714 },
1715 /*slot_types_out*/
1716 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1717 {{'\0'}},
1718 },
1722};
1723
1724/*
1725 * Create Cube
1726 *
1727 * Creates a cube.
1728 */
1730 "create_cube",
1731 /*slot_types_in*/
1732 {{"size", BMO_OP_SLOT_FLT}, /* size of the cube */
1733 {"matrix", BMO_OP_SLOT_MAT}, /* matrix to multiply the new geometry with */
1734 {"calc_uvs", BMO_OP_SLOT_BOOL}, /* calculate default UVs */
1735 {{'\0'}},
1736 },
1737 /*slot_types_out*/
1738 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1739 {{'\0'}},
1740 },
1744};
1745
1747 {BEVEL_AMT_OFFSET, "OFFSET"},
1748 {BEVEL_AMT_WIDTH, "WIDTH"},
1749 {BEVEL_AMT_DEPTH, "DEPTH"},
1750 {BEVEL_AMT_PERCENT, "PERCENT"},
1751 {BEVEL_AMT_ABSOLUTE, "ABSOLUTE"},
1752 {0, nullptr},
1753};
1754
1756 {BEVEL_PROFILE_SUPERELLIPSE, "SUPERELLIPSE"},
1757 {BEVEL_PROFILE_CUSTOM, "CUSTOM"},
1758 {0, nullptr},
1759};
1760
1762 {BEVEL_FACE_STRENGTH_NONE, "NONE"},
1763 {BEVEL_FACE_STRENGTH_NEW, "NEW"},
1764 {BEVEL_FACE_STRENGTH_AFFECTED, "AFFECTED"},
1765 {BEVEL_FACE_STRENGTH_ALL, "ALL"},
1766 {0, nullptr},
1767};
1768
1770 {BEVEL_MITER_SHARP, "SHARP"},
1771 {BEVEL_MITER_PATCH, "PATCH"},
1772 {BEVEL_MITER_ARC, "ARC"},
1773 {0, nullptr},
1774};
1775
1777 {BEVEL_VMESH_ADJ, "ADJ"},
1778 {BEVEL_VMESH_CUTOFF, "CUTOFF"},
1779 {0, nullptr},
1780};
1781
1783 {BEVEL_AFFECT_VERTICES, "VERTICES"},
1784 {BEVEL_AFFECT_EDGES, "EDGES"},
1785 {0, nullptr},
1786};
1787
1788/*
1789 * Bevel.
1790 *
1791 * Bevels edges and vertices
1792 */
1794 "bevel",
1795 /*slot_types_in*/
1796 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */
1797 {"offset", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */
1799 bmo_enum_bevel_offset_type}, /* how to measure the offset */
1801 bmo_enum_bevel_profile_type}, /* The profile type to use for bevel. */
1802 {"segments", BMO_OP_SLOT_INT}, /* number of segments in bevel */
1803 {"profile", BMO_OP_SLOT_FLT}, /* profile shape, 0->1 (.5=>round) */
1805 bmo_enum_bevel_affect_type}, /* Whether to bevel vertices or edges. */
1806 {"clamp_overlap", BMO_OP_SLOT_BOOL}, /* do not allow beveled edges/vertices to overlap each other */
1807 {"material", BMO_OP_SLOT_INT}, /* material for bevel faces, -1 means get from adjacent faces */
1808 {"loop_slide", BMO_OP_SLOT_BOOL}, /* prefer to slide along edges to having even widths */
1809 {"mark_seam", BMO_OP_SLOT_BOOL}, /* extend edge data to allow seams to run across bevels */
1810 {"mark_sharp", BMO_OP_SLOT_BOOL}, /* extend edge data to allow sharp edges to run across bevels */
1811 {"harden_normals", BMO_OP_SLOT_BOOL}, /* harden normals */
1813 bmo_enum_bevel_face_strength_type}, /* whether to set face strength, and which faces to set if so */
1815 bmo_enum_bevel_miter_type}, /* outer miter kind */
1817 bmo_enum_bevel_miter_type}, /* outer miter kind */
1818 {"spread", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */
1819 {"custom_profile", BMO_OP_SLOT_PTR, to_subtype_union(BMO_OP_SLOT_SUBTYPE_PTR_STRUCT)}, /* CurveProfile, if None ignored */
1821 bmo_enum_bevel_vmesh_method}, /* The method to use to create meshes at intersections. */
1822 {{'\0'}},
1823 },
1824 /*slot_types_out*/
1825 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
1826 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */
1827 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
1828 {{'\0'}},
1829 },
1830
1836};
1837
1838/* no enum is defined for this */
1840 {0, "AREA"},
1841 {1, "ANGLE"},
1842 {0, nullptr},
1843};
1844
1845/*
1846 * Beautify Fill.
1847 *
1848 * Rotate edges to create more evenly spaced triangles.
1849 */
1851 "beautify_fill",
1852 /*slot_types_in*/
1853 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1854 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* edges that can be flipped */
1855 {"use_restrict_tag", BMO_OP_SLOT_BOOL}, /* restrict edge rotation to mixed tagged vertices */
1856 {"method", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_beautify_fill_method}, /* method to define what is beautiful */
1857 {{'\0'}},
1858 },
1859 /*slot_types_out*/
1860 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* new flipped faces and edges */
1861 {{'\0'}},
1862 },
1868};
1869
1870/*
1871 * Triangle Fill.
1872 *
1873 * Fill edges with triangles
1874 */
1876 "triangle_fill",
1877 /*slot_types_in*/
1878 {{"use_beauty", BMO_OP_SLOT_BOOL}, /* use best triangulation division */
1879 {"use_dissolve", BMO_OP_SLOT_BOOL}, /* dissolve resulting faces */
1880 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1881 {"normal", BMO_OP_SLOT_VEC}, /* optionally pass the fill normal to use */
1882 {{'\0'}},
1883 },
1884 /*slot_types_out*/
1885 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* new faces and edges */
1886 {{'\0'}},
1887 },
1892};
1893
1894/*
1895 * Solidify.
1896 *
1897 * Turns a mesh into a shell with thickness
1898 */
1900 "solidify",
1901 /*slot_types_in*/
1902 {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
1903 {"thickness", BMO_OP_SLOT_FLT}, /* thickness */
1904 {{'\0'}},
1905 },
1906 /*slot_types_out*/
1907 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1908 {{'\0'}},
1909 },
1913};
1914
1915/*
1916 * Face Inset (Individual).
1917 *
1918 * Insets individual faces.
1919 */
1921 "inset_individual",
1922 /*slot_types_in*/
1923 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1924 {"thickness", BMO_OP_SLOT_FLT}, /* thickness */
1925 {"depth", BMO_OP_SLOT_FLT}, /* depth */
1926 {"use_even_offset", BMO_OP_SLOT_BOOL}, /* scale the offset to give more even thickness */
1927 {"use_interpolate", BMO_OP_SLOT_BOOL}, /* blend face data across the inset */
1928 {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* scale the offset by surrounding geometry */
1929 {{'\0'}},
1930 },
1931 /*slot_types_out*/
1932 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
1933 {{'\0'}},
1934 },
1936 /* caller needs to handle BMO_OPTYPE_FLAG_SELECT_FLUSH */
1938};
1939
1940/*
1941 * Face Inset (Regions).
1942 *
1943 * Inset or outset face regions.
1944 */
1946 "inset_region",
1947 /*slot_types_in*/
1948 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1949 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces to explicitly exclude from inset */
1950 {"use_boundary", BMO_OP_SLOT_BOOL}, /* inset face boundaries */
1951 {"use_even_offset", BMO_OP_SLOT_BOOL}, /* scale the offset to give more even thickness */
1952 {"use_interpolate", BMO_OP_SLOT_BOOL}, /* blend face data across the inset */
1953 {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* scale the offset by surrounding geometry */
1954 {"use_edge_rail", BMO_OP_SLOT_BOOL}, /* inset the region along existing edges */
1955 {"thickness", BMO_OP_SLOT_FLT}, /* thickness */
1956 {"depth", BMO_OP_SLOT_FLT}, /* depth */
1957 {"use_outset", BMO_OP_SLOT_BOOL}, /* outset rather than inset */
1958 {{'\0'}},
1959 },
1960 /*slot_types_out*/
1961 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
1962 {{'\0'}},
1963 },
1967};
1968
1969/*
1970 * Edge-loop Offset.
1971 *
1972 * Creates edge loops based on simple edge-outset method.
1973 */
1975 "offset_edgeloops",
1976 /*slot_types_in*/
1977 {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
1978 {"use_cap_endpoint", BMO_OP_SLOT_BOOL}, /* extend loop around end-points */
1979 {{'\0'}},
1980 },
1981 /*slot_types_out*/
1982 {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */
1983 {{'\0'}},
1984 },
1988};
1989
1990/*
1991 * Wire Frame.
1992 *
1993 * Makes a wire-frame copy of faces.
1994 */
1996 "wireframe",
1997 /*slot_types_in*/
1998 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
1999 {"thickness", BMO_OP_SLOT_FLT}, /* thickness */
2000 {"offset", BMO_OP_SLOT_FLT}, /* offset the thickness from the center */
2001 {"use_replace", BMO_OP_SLOT_BOOL}, /* remove original geometry */
2002 {"use_boundary", BMO_OP_SLOT_BOOL}, /* inset face boundaries */
2003 {"use_even_offset", BMO_OP_SLOT_BOOL}, /* scale the offset to give more even thickness */
2004 {"use_crease", BMO_OP_SLOT_BOOL}, /* crease hub edges for improved subdivision surface */
2005 {"crease_weight", BMO_OP_SLOT_FLT}, /* the mean crease weight for resulting edges */
2006 {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* scale the offset by surrounding geometry */
2007 {"material_offset", BMO_OP_SLOT_INT}, /* offset material index of generated faces */
2008 {{'\0'}},
2009 },
2010 /*slot_types_out*/
2011 {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
2012 {{'\0'}},
2013 },
2018};
2019
2021 {BMOP_POKE_MEDIAN_WEIGHTED, "MEAN_WEIGHTED"},
2022 {BMOP_POKE_MEDIAN, "MEAN"},
2023 {BMOP_POKE_BOUNDS, "BOUNDS"},
2024 {0, nullptr},
2025};
2026
2027/*
2028 * Pokes a face.
2029 *
2030 * Splits a face into a triangle fan.
2031 */
2033 "poke",
2034 /*slot_types_in*/
2035 {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
2036 {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */
2037 {"center_mode", BMO_OP_SLOT_INT, to_subtype_union(BMO_OP_SLOT_SUBTYPE_INT_ENUM), bmo_enum_poke_center_mode}, /* calculation mode for center vertex */
2038 {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* apply offset */
2039 {{'\0'}},
2040 },
2041 /*slot_types_out*/
2042 {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */
2043 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
2044 {{'\0'}},
2045 },
2050};
2051
2052#ifdef WITH_BULLET
2053/*
2054 * Convex Hull
2055 *
2056 * Builds a convex hull from the vertices in 'input'.
2057 *
2058 * If 'use_existing_faces' is true, the hull will not output triangles
2059 * that are covered by a pre-existing face.
2060 *
2061 * All hull vertices, faces, and edges are added to 'geom.out'. Any
2062 * input elements that end up inside the hull (i.e. are not used by an
2063 * output face) are added to the 'interior_geom' slot. The
2064 * 'unused_geom' slot will contain all interior geometry that is
2065 * completely unused. Lastly, 'holes_geom' contains edges and faces
2066 * that were in the input and are part of the hull.
2067 */
2068static BMOpDefine bmo_convex_hull_def = {
2069 "convex_hull",
2070 /*slot_types_in*/
2071 {{"input", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
2072 {"use_existing_faces", BMO_OP_SLOT_BOOL}, /* skip hull triangles that are covered by a pre-existing face */
2073 {{'\0'}},
2074 },
2075 /*slot_types_out*/
2076 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2077 {"geom_interior.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2078 {"geom_unused.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2079 {"geom_holes.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2080 {{'\0'}},
2081 },
2086};
2087#endif
2088
2089/*
2090 * Symmetrize.
2091 *
2092 * Makes the mesh elements in the "input" slot symmetrical. Unlike
2093 * normal mirroring, it only copies in one direction, as specified by
2094 * the "direction" slot. The edges and faces that cross the plane of
2095 * symmetry are split as needed to enforce symmetry.
2096 *
2097 * All new vertices, edges, and faces are added to the "geom.out" slot.
2098 */
2100 "symmetrize",
2101 /*slot_types_in*/
2102 {{"input", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */
2104 {"dist", BMO_OP_SLOT_FLT}, /* minimum distance */
2105 {"use_shapekey", BMO_OP_SLOT_BOOL}, /* Transform shape keys too. */
2106 {{'\0'}},
2107 },
2108 /*slot_types_out*/
2109 {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2110 {{'\0'}},
2111 },
2116};
2117
2118/* clang-format on */
2119
2120#undef BM_FACE
2121#undef BM_EDGE
2122#undef BM_VERT
2123
2138#ifdef WITH_BULLET
2139 &bmo_convex_hull_def,
2140#endif
2177 &bmo_poke_def,
2193 &bmo_spin_def,
2207};
2208
#define ARRAY_SIZE(arr)
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
@ MOD_TRIANGULATE_QUAD_FIXED
@ MOD_TRIANGULATE_QUAD_LONGEDGE
@ MOD_TRIANGULATE_QUAD_BEAUTY
@ MOD_TRIANGULATE_QUAD_ALTERNATE
@ MOD_TRIANGULATE_NGON_BEAUTY
@ MOD_TRIANGULATE_NGON_EARCLIP
static BMOpDefine bmo_planar_faces_def
static BMOpDefine bmo_edgenet_fill_def
static BMOpDefine bmo_bevel_def
static BMOpDefine bmo_reverse_colors_def
static BMOpDefine bmo_find_doubles_def
static BMOpDefine bmo_connect_verts_concave_def
static BMOpDefine bmo_create_cone_def
static BMOpDefine bmo_unsubdivide_def
static BMOpDefine bmo_create_monkey_def
static BMOpDefine bmo_rotate_colors_def
static BMO_FlagSet bmo_enum_delete_context[]
static BMOpDefine bmo_dissolve_limit_def
static BMOpDefine bmo_join_triangles_def
static BMOpDefine bmo_reverse_uvs_def
static BMOpDefine bmo_extrude_face_region_def
static BMO_FlagSet bmo_enum_triangulate_quad_method[]
static BMO_FlagSet bmo_enum_bevel_miter_type[]
static BMOpDefine bmo_dissolve_edges_def
static BMOpDefine bmo_bmesh_to_mesh_def
static BMOpDefine bmo_extrude_edge_only_def
static BMO_FlagSet bmo_enum_dissolve_limit_flags[]
static BMO_FlagSet bmo_enum_bevel_offset_type[]
static BMOpDefine bmo_create_cube_def
static BMOpDefine bmo_edgeloop_fill_def
static BMOpDefine bmo_solidify_def
static BMOpDefine bmo_extrude_vert_indiv_def
static BMOpDefine bmo_offset_edgeloops_def
static BMOpDefine bmo_bisect_edges_def
#define BM_FACE
static BMOpDefine bmo_create_uvsphere_def
static BMOpDefine bmo_mesh_to_bmesh_def
static BMOpDefine bmo_inset_region_def
static BMOpDefine bmo_create_vert_def
static BMOpDefine bmo_smooth_laplacian_vert_def
static BMOpDefine bmo_bisect_plane_def
static BMOpDefine bmo_rotate_edges_def
static BMO_FlagSet bmo_enum_bevel_profile_type[]
static BMOpDefine bmo_create_grid_def
static BMOpDefine bmo_dissolve_verts_def
static BMOpDefine bmo_split_def
static BMOpDefine bmo_average_vert_facedata_def
static BMO_FlagSet bmo_enum_beautify_fill_method[]
static BMOpDefine bmo_connect_verts_nonplanar_def
static BMOpDefine bmo_edgenet_prepare_def
#define BM_EDGE
static BMOpDefine bmo_triangle_fill_def
static BMOpDefine bmo_region_extend_def
static BMOpDefine bmo_split_edges_def
static BMOpDefine bmo_wireframe_def
static BMOpDefine bmo_poke_def
static BMOpDefine bmo_face_attribute_fill_def
static BMOpDefine bmo_translate_def
static BMOpDefine bmo_dissolve_faces_def
static BMOpDefine bmo_mirror_def
static BMO_FlagSet bmo_enum_bevel_face_strength_type[]
static BMOpDefine bmo_contextual_create_def
static BMO_FlagSet bmo_enum_falloff_type[]
static BMOpDefine bmo_smooth_vert_def
static BMOpDefine bmo_reverse_faces_def
static BMOpDefine bmo_dissolve_degenerate_def
static BMOpDefine bmo_pointmerge_facedata_def
static BMOpDefine bmo_duplicate_def
static BMOpDefine bmo_extrude_discrete_faces_def
static BMO_FlagSet bmo_enum_bevel_vmesh_method[]
static BMOpDefine bmo_collapse_uvs_def
static BMO_FlagSet bmo_enum_subdivide_edgering_interp_mode[]
static eBMOpSlotSubType_Union to_subtype_union(const eBMOpSlotSubType_Ptr ptr)
static BMOpDefine bmo_subdivide_edgering_def
static BMOpDefine bmo_flip_quad_tessellation_def
static BMOpDefine bmo_remove_doubles_def
static BMOpDefine bmo_beautify_fill_def
static BMOpDefine bmo_pointmerge_def
static BMOpDefine bmo_weld_verts_def
static BMOpDefine bmo_rotate_uvs_def
static BMOpDefine bmo_triangulate_def
static BMOpDefine bmo_bridge_loops_def
static BMOpDefine bmo_spin_def
static BMOpDefine bmo_subdivide_edges_def
static BMOpDefine bmo_delete_def
static BMOpDefine bmo_object_load_bmesh_def
static BMOpDefine bmo_inset_individual_def
static BMOpDefine bmo_symmetrize_def
static BMOpDefine bmo_holes_fill_def
const int bmo_opdefines_total
const BMOpDefine * bmo_opdefines[]
static BMOpDefine bmo_transform_def
static BMO_FlagSet bmo_enum_axis_neg_xyz_and_xyz[]
static BMOpDefine bmo_grid_fill_def
static BMO_FlagSet bmo_enum_bevel_affect_type[]
static BMOpDefine bmo_connect_verts_def
static BMOpDefine bmo_collapse_def
static BMO_FlagSet bmo_enum_subdivide_edges_quad_corner_type[]
static BMOpDefine bmo_rotate_def
static BMOpDefine bmo_connect_vert_pair_def
static BMOpDefine bmo_create_circle_def
#define BM_VERT
static BMO_FlagSet bmo_enum_triangulate_ngon_method[]
static BMO_FlagSet bmo_enum_poke_center_mode[]
static BMOpDefine bmo_create_icosphere_def
static BMOpDefine bmo_scale_def
static BMO_FlagSet bmo_enum_axis_xyz[]
static BMOpDefine bmo_recalc_face_normals_def
eBMOpSlotSubType_Ptr
@ BMO_OP_SLOT_SUBTYPE_PTR_BMESH
@ BMO_OP_SLOT_SUBTYPE_PTR_OBJECT
@ BMO_OP_SLOT_SUBTYPE_PTR_SCENE
@ BMO_OP_SLOT_SUBTYPE_PTR_MESH
@ BMO_OP_SLOT_SUBTYPE_PTR_STRUCT
eBMOpSlotSubType_Elem
@ BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE
@ BMO_OP_SLOT_ELEMENT_BUF
@ BMO_OP_SLOT_PTR
@ BMO_OP_SLOT_BOOL
@ BMO_OP_SLOT_FLT
@ BMO_OP_SLOT_INT
@ BMO_OP_SLOT_VEC
@ BMO_OP_SLOT_MAPPING
@ BMO_OP_SLOT_MAT
eBMOpSlotSubType_Map
@ BMO_OP_SLOT_SUBTYPE_MAP_ELEM
@ BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL
@ BMO_OP_SLOT_SUBTYPE_MAP_EMPTY
@ BMO_OP_SLOT_SUBTYPE_MAP_FLT
eBMOpSlotSubType_Int
@ BMO_OP_SLOT_SUBTYPE_INT_FLAG
@ BMO_OP_SLOT_SUBTYPE_INT_ENUM
@ DEL_ONLYTAGGED
@ DEL_FACES_KEEP_BOUNDARY
@ DEL_EDGESFACES
@ DEL_ONLYFACES
@ BMO_OPTYPE_FLAG_NOP
@ BMO_OPTYPE_FLAG_SELECT_VALIDATE
@ BMO_OPTYPE_FLAG_UNTAN_MULTIRES
@ BMO_OPTYPE_FLAG_NORMALS_CALC
@ BMO_OPTYPE_FLAG_SELECT_FLUSH
@ BMO_DELIM_NORMAL
@ BMO_DELIM_MATERIAL
@ BMO_DELIM_SEAM
@ BMO_DELIM_SHARP
@ BMO_DELIM_UV
@ BEVEL_VMESH_ADJ
@ BEVEL_VMESH_CUTOFF
@ SUBD_FALLOFF_SHARP
@ SUBD_FALLOFF_SMOOTH
@ SUBD_FALLOFF_INVSQUARE
@ SUBD_FALLOFF_SPHERE
@ SUBD_FALLOFF_LIN
@ SUBD_FALLOFF_ROOT
@ SUBD_CORNER_FAN
@ SUBD_CORNER_STRAIGHT_CUT
@ SUBD_CORNER_PATH
@ SUBD_CORNER_INNERVERT
@ SUBD_RING_INTERP_SURF
@ SUBD_RING_INTERP_PATH
@ SUBD_RING_INTERP_LINEAR
@ BEVEL_AMT_WIDTH
@ BEVEL_AMT_ABSOLUTE
@ BEVEL_AMT_PERCENT
@ BEVEL_AMT_OFFSET
@ BEVEL_AMT_DEPTH
@ BEVEL_MITER_PATCH
@ BEVEL_MITER_SHARP
@ BEVEL_MITER_ARC
@ BEVEL_PROFILE_SUPERELLIPSE
@ BEVEL_PROFILE_CUSTOM
@ BMOP_POKE_MEDIAN_WEIGHTED
@ BMOP_POKE_BOUNDS
@ BMOP_POKE_MEDIAN
@ BEVEL_FACE_STRENGTH_NONE
@ BEVEL_FACE_STRENGTH_AFFECTED
@ BEVEL_FACE_STRENGTH_NEW
@ BEVEL_FACE_STRENGTH_ALL
@ BEVEL_AFFECT_VERTICES
@ BEVEL_AFFECT_EDGES
void bmo_rotate_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:115
void bmo_region_extend_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:381
void bmo_offset_edgeloops_exec(BMesh *bm, BMOperator *op)
void bmo_symmetrize_exec(BMesh *bm, BMOperator *op)
void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
void bmo_reverse_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:563
void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
Definition bmo_inset.cc:662
void bmo_face_attribute_fill_exec(BMesh *bm, BMOperator *op)
void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
void bmo_bevel_exec(BMesh *bm, BMOperator *op)
Definition bmo_bevel.cc:21
void bmo_mirror_exec(BMesh *bm, BMOperator *op)
Definition bmo_mirror.cc:20
void bmo_collapse_exec(BMesh *bm, BMOperator *op)
void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
void bmo_split_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:436
void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op)
void bmo_flip_quad_tessellation_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:151
void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
void bmo_transform_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:40
void bmo_average_vert_facedata_exec(BMesh *bm, BMOperator *op)
void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op)
void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
void bmo_remove_doubles_exec(BMesh *bm, BMOperator *op)
void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
void bmo_reverse_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:708
void bmo_connect_verts_nonplanar_exec(BMesh *bm, BMOperator *op)
void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
Definition bmo_create.cc:22
void bmo_inset_individual_exec(BMesh *bm, BMOperator *op)
Definition bmo_inset.cc:410
void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:604
void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:477
void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
void bmo_bisect_edges_exec(BMesh *bm, BMOperator *op)
void bmo_edgeloop_fill_exec(BMesh *bm, BMOperator *op)
void bmo_bisect_plane_exec(BMesh *bm, BMOperator *op)
void bmo_pointmerge_exec(BMesh *bm, BMOperator *op)
void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
void bmo_connect_verts_exec(BMesh *bm, BMOperator *op)
void bmo_connect_verts_concave_exec(BMesh *bm, BMOperator *op)
void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
void bmo_duplicate_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:373
void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
void bmo_translate_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:71
void bmo_pointmerge_facedata_exec(BMesh *bm, BMOperator *op)
void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op)
void bmo_create_vert_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:30
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
void bmo_holes_fill_exec(BMesh *bm, BMOperator *op)
void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
void bmo_spin_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:518
void bmo_planar_faces_exec(BMesh *bm, BMOperator *op)
void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op)
void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
void bmo_find_doubles_exec(BMesh *bm, BMOperator *op)
void bmo_smooth_vert_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:399
void bmo_poke_exec(BMesh *bm, BMOperator *op)
Definition bmo_poke.cc:30
void bmo_delete_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:498
void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
void bmo_grid_fill_exec(BMesh *bm, BMOperator *op)
void bmo_scale_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:92
void bmo_collapse_uvs_exec(BMesh *bm, BMOperator *op)
void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op)
void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
void bmo_reverse_faces_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:136
void bmo_weld_verts_exec(BMesh *bm, BMOperator *op)
eBMOpSlotSubType_Ptr ptr
eBMOpSlotSubType_Int intg
eBMOpSlotSubType_Map map
PointerRNA * ptr
Definition wm_files.cc:4126