Blender V5.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
37
38#include "BLI_utildefines.hh"
39
40#include "bmesh.hh"
42
43#include "DNA_modifier_types.h"
44
45namespace blender {
46
82
83/* Keep struct definition from wrapping. */
84
85/* Enums shared between multiple operators. */
86
88 {0, "X"},
89 {1, "Y"},
90 {2, "Z"},
91 {0, nullptr},
92};
93
95 {0, "-X"},
96 {1, "-Y"},
97 {2, "-Z"},
98 {3, "X"},
99 {4, "Y"},
100 {5, "Z"},
101 {0, nullptr},
102};
103
105 {SUBD_FALLOFF_SMOOTH, "SMOOTH"},
106 {SUBD_FALLOFF_SPHERE, "SPHERE"},
107 {SUBD_FALLOFF_ROOT, "ROOT"},
108 {SUBD_FALLOFF_SHARP, "SHARP"},
109 {SUBD_FALLOFF_LIN, "LINEAR"},
110 {SUBD_FALLOFF_INVSQUARE, "INVERSE_SQUARE"},
111 {0, nullptr},
112};
113
115{
117 value.ptr = ptr;
118 return value;
119}
120
122{
124 value.map = map;
125 return value;
126}
127
129{
131 value.intg = intg;
132 return value;
133}
134
135/* Quiet 'enum-conversion' warning. */
136#define BM_FACE ((eBMOpSlotSubType_Elem)BM_FACE)
137#define BM_EDGE ((eBMOpSlotSubType_Elem)BM_EDGE)
138#define BM_VERT ((eBMOpSlotSubType_Elem)BM_VERT)
139
140/*
141 * Vertex Smooth.
142 *
143 * Smooths vertices by using a basic vertex averaging scheme.
144 */
146 /*opname*/ "smooth_vert",
147 /*slot_types_in*/
148 {
149 /* Input vertices. */
150 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
151 /* Smoothing factor. */
152 {"factor", BMO_OP_SLOT_FLT},
153 /* Set vertices close to the x axis before the operation to 0. */
154 {"mirror_clip_x", BMO_OP_SLOT_BOOL},
155 /* Set vertices close to the y axis before the operation to 0. */
156 {"mirror_clip_y", BMO_OP_SLOT_BOOL},
157 /* Set vertices close to the z axis before the operation to 0. */
158 {"mirror_clip_z", BMO_OP_SLOT_BOOL},
159 /* Clipping threshold for the above three slots. */
160 {"clip_dist", BMO_OP_SLOT_FLT},
161 /* Smooth vertices along X axis. */
162 {"use_axis_x", BMO_OP_SLOT_BOOL},
163 /* Smooth vertices along Y axis. */
164 {"use_axis_y", BMO_OP_SLOT_BOOL},
165 /* Smooth vertices along Z axis. */
166 {"use_axis_z", BMO_OP_SLOT_BOOL},
167 {{'\0'}},
168 },
169 /*slot_types_out*/
170 {{{'\0'}}},
171 /*init*/ nullptr,
172 /*exec*/ bmo_smooth_vert_exec,
173 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
174};
175
176/*
177 * Vertex Smooth Laplacian.
178 *
179 * Smooths vertices by using Laplacian smoothing proposed by
180 * Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow.
181 */
183 /*opname*/ "smooth_laplacian_vert",
184 /*slot_types_in*/
185 {
186 /* Input vertices. */
187 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
188 /* Lambda parameter. */
189 {"lambda_factor", BMO_OP_SLOT_FLT},
190 /* Lambda param in border. */
191 {"lambda_border", BMO_OP_SLOT_FLT},
192 /* Smooth object along X axis. */
193 {"use_x", BMO_OP_SLOT_BOOL},
194 /* Smooth object along Y axis. */
195 {"use_y", BMO_OP_SLOT_BOOL},
196 /* Smooth object along Z axis. */
197 {"use_z", BMO_OP_SLOT_BOOL},
198 /* Apply volume preservation after smooth. */
199 {"preserve_volume", BMO_OP_SLOT_BOOL},
200 {{'\0'}},
201 },
202 /*slot_types_out*/
203 {{{'\0'}}},
204 /*init*/ nullptr,
206 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
207};
208
209/*
210 * Right-Hand Faces.
211 *
212 * Computes an "outside" normal for the specified input faces.
213 */
215 /*opname*/ "recalc_face_normals",
216 /*slot_types_in*/
217 {
218 /* Input faces. */
219 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
220 {{'\0'}},
221 },
222 /*slot_types_out*/
223 {{{'\0'}}},
224 /*init*/ nullptr,
227};
228
234
235/*
236 * Relax Edge Loops.
237 *
238 * Relax the loop, so it is smoother.
239 */
241 /*opname*/ "relax_edge_loops",
242 /*slot_types_in*/
243 {
244 /* Input geometry. */
245 {"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
246 /* Method used for interpolation. */
247 {"interpolation",
251 /* Number of relaxation passes. */
252 {"iterations", BMO_OP_SLOT_INT},
253 /* Distribute vertices at constant distances along the loop. */
254 {"even_spacing", BMO_OP_SLOT_BOOL},
255 },
256 /*slot_types_out*/
257 {{{'\0'}}},
258 /*init*/ nullptr,
260 /*type_flag*/
262};
263
264/*
265 * Planar Faces.
266 *
267 * Iteratively flatten faces.
268 */
270 /*opname*/ "planar_faces",
271 /*slot_types_in*/
272 {
273 /* Input geometry. */
274 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
275 /* Number of times to flatten faces (for when connected faces are used) */
276 {"iterations", BMO_OP_SLOT_INT},
277 /* Influence for making planar each iteration */
278 {"factor", BMO_OP_SLOT_FLT},
279 {{'\0'}},
280 },
281 /*slot_types_out*/
282 {
283 /* Output slot, computed boundary geometry. */
284 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
285 {{'\0'}},
286 },
287 /*init*/ nullptr,
288 /*exec*/ bmo_planar_faces_exec,
290};
291
292/*
293 * Region Extend.
294 *
295 * Used to implement the select more/less tools.
296 * Puts geometry surrounding regions of geometry in `geom` into `geom.out`.
297 *
298 * If `use_faces` is 0 then `geom.out` spits out verts and edges,
299 * otherwise it spits out faces.
300 */
302 /*opname*/ "region_extend",
303 /*slot_types_in*/
304 {
305 /* Input geometry. */
307 /* Find boundary inside the regions, not outside. */
308 {"use_contract", BMO_OP_SLOT_BOOL},
309 /* Extend from faces instead of edges. */
310 {"use_faces", BMO_OP_SLOT_BOOL},
311 /* Step over connected faces. */
312 {"use_face_step", BMO_OP_SLOT_BOOL},
313 {{'\0'}},
314 },
315 /*slot_types_out*/
316 {
317 /* Output slot, computed boundary geometry. */
318 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
319 {{'\0'}},
320 },
321 /*init*/ nullptr,
322 /*exec*/ bmo_region_extend_exec,
324};
325
326/*
327 * Edge Rotate.
328 *
329 * Rotates edges topologically. Also known as "spin edge" to some people.
330 * Simple example: `[/] becomes [|] then [\‍]`.
331 */
333 /*opname*/ "rotate_edges",
334 /*slot_types_in*/
335 {
336 /* Input edges. */
337 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
338 /* Rotate edge counter-clockwise if true, otherwise clockwise. */
339 {"use_ccw", BMO_OP_SLOT_BOOL},
340 {{'\0'}},
341 },
342 /*slot_types_out*/
343 {
344 /* Newly spun edges. */
345 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
346 {{'\0'}},
347 },
348 /*init*/ nullptr,
349 /*exec*/ bmo_rotate_edges_exec,
350 /*type_flag*/
353};
354
355/*
356 * Reverse Faces.
357 *
358 * Reverses the winding (vertex order) of faces.
359 * This has the effect of flipping the normal.
360 */
362 /*opname*/ "reverse_faces",
363 /*slot_types_in*/
364 {
365 /* Input faces. */
366 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
367 /* Maintain multi-res offset. */
368 {"flip_multires", BMO_OP_SLOT_BOOL},
369 {{'\0'}},
370 },
371 /*slot_types_out*/
372 {{{'\0'}}},
373 /*init*/ nullptr,
374 /*exec*/ bmo_reverse_faces_exec,
376};
377
378/*
379 * Flip Quad Tessellation
380 *
381 * Flip the tessellation direction of the selected quads.
382 */
384 /*opname*/ "flip_quad_tessellation",
385 /*slot_types_in*/
386 {
387 /* Input faces. */
388 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
389 {{'\0'}},
390 },
391 /*slot_types_out*/
392 {{{'\0'}}},
393 /*init*/ nullptr,
396};
397
398/*
399 * Edge Bisect.
400 *
401 * Splits input edges (but doesn't do anything else).
402 * This creates a 2-valence vert.
403 */
405 /*opname*/ "bisect_edges",
406 /*slot_types_in*/
407 {
408 /* Input edges. */
409 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
410 /* Number of cuts. */
411 {"cuts", BMO_OP_SLOT_INT},
412 {"edge_percents",
415 {{'\0'}},
416 },
417 /*slot_types_out*/
418 {
419 /* Newly created vertices and edges. */
420 {"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
421 {{'\0'}},
422 },
423 /*init*/ nullptr,
424 /*exec*/ bmo_bisect_edges_exec,
425 /*type_flag*/
428};
429
430/*
431 * Mirror.
432 *
433 * Mirrors geometry along an axis. The resulting geometry is welded on using
434 * `merge_dist`. Pairs of original/mirrored vertices are welded using the `merge_dist`
435 * parameter (which defines the minimum distance for welding to happen).
436 */
438 /*opname*/ "mirror",
439 /*slot_types_in*/
440 {
441 /* Input geometry. */
443 /* Matrix defining the mirror transformation. */
444 {"matrix", BMO_OP_SLOT_MAT},
445 /* Maximum distance for merging. does no merging if 0. */
446 {"merge_dist", BMO_OP_SLOT_FLT},
447 /* The axis to use. */
448 {"axis",
452 /* Mirror UVs across the u axis. */
453 {"mirror_u", BMO_OP_SLOT_BOOL},
454 /* Mirror UVs across the v axis. */
455 {"mirror_v", BMO_OP_SLOT_BOOL},
456 /* Mirror UVs in each tile. */
457 {"mirror_udim", BMO_OP_SLOT_BOOL},
458 /* Transform shape keys too. */
459 {"use_shapekey", BMO_OP_SLOT_BOOL},
460 {{'\0'}},
461 },
462 /*slot_types_out*/
463 {
464 /* Output geometry, mirrored. */
465 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
466 {{'\0'}},
467 },
468 /*init*/ nullptr,
469 /*exec*/ bmo_mirror_exec,
470 /*type_flag*/
473};
474
475/*
476 * Find Doubles.
477 *
478 * Takes input verts and finds vertices they should weld to.
479 * Outputs a mapping slot suitable for use with the weld verts BMOP.
480 *
481 * If `keep_verts` is used, vertices outside that set can only be merged
482 * with vertices in that set.
483 */
485 /*opname*/ "find_doubles",
486 /*slot_types_in*/
487 {
488 /* Input vertices. */
489 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
490 /* List of verts to keep. */
491 {"keep_verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
492 /* Limit the search for doubles by connected geometry. */
493 {"use_connected", BMO_OP_SLOT_BOOL},
494 /* Maximum distance. */
495 {"dist", BMO_OP_SLOT_FLT},
496 {{'\0'}},
497 },
498 /*slot_types_out*/
499 {
500 {"targetmap.out",
503 {{'\0'}},
504 },
505 /*init*/ nullptr,
506 /*exec*/ bmo_find_doubles_exec,
507 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
508};
509
510/*
511 * Remove Doubles.
512 *
513 * Finds groups of vertices closer than dist and merges them together,
514 * using the weld verts BMOP.
515 */
517 /*opname*/ "remove_doubles",
518 /*slot_types_in*/
519 {
520 /* Input verts. */
521 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
522 /* Limit the search for doubles by connected geometry. */
523 {"use_connected", BMO_OP_SLOT_BOOL},
524 /* Maximum distance. */
525 {"dist", BMO_OP_SLOT_FLT},
526 {{'\0'}},
527 },
528 /*slot_types_out*/
529 {{{'\0'}}},
530 /*init*/ nullptr,
532 /*type_flag*/
535};
536
537/*
538 * Circularize.
539 *
540 * Shape selected geometry into a circle.
541 */
543 /*opname*/ "circularize",
544 /*slot_types_in*/
545 {
546 /* Input geometry. */
548 /* Influence factor: spans from 0.0 to 1.0. */
549 {"factor", BMO_OP_SLOT_FLT},
550 /* Custom radius. */
551 {"custom_radius", BMO_OP_SLOT_FLT},
552 /* Rotation angle. */
553 {"angle", BMO_OP_SLOT_FLT},
554 /* Method to fit the circle. */
555 {"fit_method", BMO_OP_SLOT_INT},
556 /* Flatten factor: 0.0 projects onto the mesh, 1.0 flattens on the optimal plane. */
557 {"flatten", BMO_OP_SLOT_FLT},
558 /* Distributes vertices at constant distances, otherwise preserves original spacing. */
559 {"regular", BMO_OP_SLOT_BOOL},
560 /* Lock X-axis editing. */
561 {"lock_x", BMO_OP_SLOT_BOOL},
562 /* Lock Y-axis editing. */
563 {"lock_y", BMO_OP_SLOT_BOOL},
564 /* Lock Z-axis editing. */
565 {"lock_z", BMO_OP_SLOT_BOOL},
566 /* Use X axis of the mirror modifier. */
567 {"mirror_x", BMO_OP_SLOT_BOOL},
568 /* Use Y axis of the mirror modifier. */
569 {"mirror_y", BMO_OP_SLOT_BOOL},
570 /* Use Z axis of the mirror modifier. */
571 {"mirror_z", BMO_OP_SLOT_BOOL},
572 {{'\0'}},
573 },
574 /*slot_types_out*/
575 {{{'\0'}}},
576 /*init*/ nullptr,
577 /*exec*/ bmo_circularize_exec,
578 /*type_flag*/
580};
581
582/*
583 * Flatten.
584 *
585 * Flatten vertices on a best-fitting plane.
586 */
588 /*opname*/ "flatten",
589 /*slot_types_in*/
590 {
591 /* Input geometry. */
593 /* Influence factor: spans from 0.0 to 1.0. */
594 {"factor", BMO_OP_SLOT_FLT},
595 /* Plane on which vertices are flattened. */
596 {"method", BMO_OP_SLOT_INT},
597 /* View direction in object local space. */
598 {"view_normal", BMO_OP_SLOT_VEC},
599 /* Lock X axis editing. */
600 {"lock_x", BMO_OP_SLOT_BOOL},
601 /* Lock Y axis editing. */
602 {"lock_y", BMO_OP_SLOT_BOOL},
603 /* Lock Z axis editing. */
604 {"lock_z", BMO_OP_SLOT_BOOL},
605 {{'\0'}},
606 },
607 /*slot_types_out*/
608 {{{'\0'}}},
609 /*init*/ nullptr,
610 /*exec*/ bmo_flatten_exec,
611 /*type_flag*/
613};
614
615/*
616 * Collapse Connected.
617 *
618 * Collapses connected vertices
619 */
621 /*opname*/ "collapse",
622 /*slot_types_in*/
623 {
624 /* Input edges. */
625 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
626 /* Also collapse UVs and such. */
627 {"uvs", BMO_OP_SLOT_BOOL},
628 {{'\0'}},
629 },
630 /*slot_types_out*/
631 {{{'\0'}}},
632 /*init*/ nullptr,
633 /*exec*/ bmo_collapse_exec,
634 /*type_flag*/
637};
638
639/*
640 * Face-Data Point Merge.
641 *
642 * Merge uv/vcols at a specific vertex.
643 */
645 /*opname*/ "pointmerge_facedata",
646 /*slot_types_in*/
647 {
648 /* Input vertices. */
649 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
650 /* Target vertex to merge into. */
652 {{'\0'}},
653 },
654 /*slot_types_out*/
655 {{{'\0'}}},
656 /*init*/ nullptr,
658 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
659};
660
661/*
662 * Average Vertices Face-vert Data.
663 *
664 * Merge uv/vcols associated with the input vertices at
665 * the bounding box center.
666 */
668 /*opname*/ "average_vert_facedata",
669 /*slot_types_in*/
670 {
671 /* Input vertices. */
672 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
673 {{'\0'}},
674 },
675 /*slot_types_out*/
676 {{{'\0'}}},
677 /*init*/ nullptr,
679 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
680};
681
682/*
683 * Point Merge.
684 *
685 * Merge verts together at a point.
686 */
688 /*opname*/ "pointmerge",
689 /*slot_types_in*/
690 {
691 /* Input vertices (all verts will be merged into the first). */
692 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
693 /* Position to merge at. */
694 {"merge_co", BMO_OP_SLOT_VEC},
695 /* Optional target vertex to merge into. Does not override merge_co.
696 * Set this to preserve the custom data of the target vertex. */
698 {{'\0'}},
699 },
700 /*slot_types_out*/
701 {{{'\0'}}},
702 /*init*/ nullptr,
703 /*exec*/ bmo_pointmerge_exec,
704 /*type_flag*/
707};
708
709/*
710 * Collapse Connected UVs.
711 *
712 * Collapses connected UV vertices.
713 */
715 /*opname*/ "collapse_uvs",
716 /*slot_types_in*/
717 {
718 /* Input edges. */
719 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
720 {{'\0'}},
721 },
722 /*slot_types_out*/
723 {{{'\0'}}},
724 /*init*/ nullptr,
725 /*exec*/ bmo_collapse_uvs_exec,
726 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
727};
728
729/*
730 * Weld Verts.
731 *
732 * Welds verts together (kind-of like remove doubles, merge, etc, all of which
733 * use or will use this BMOP). You pass in mappings from vertices to the vertices
734 * they weld with.
735 */
737 /*opname*/ "weld_verts",
738 /*slot_types_in*/
739 {
740 /* Maps welded vertices to verts they should weld to. */
742 /* Merge vertices to their centroid position,
743 * otherwise use the position of the target vertex. */
744 {"use_centroid", BMO_OP_SLOT_BOOL},
745 /* Whether to average custom data of merged vertices. */
746 {"average_vert_data", BMO_OP_SLOT_BOOL},
747 {{'\0'}},
748 },
749 /*slot_types_out*/
750 {{{'\0'}}},
751 /*init*/ nullptr,
752 /*exec*/ bmo_weld_verts_exec,
753 /*type_flag*/
756};
757
758/*
759 * Make Vertex.
760 *
761 * Creates a single vertex; this BMOP was necessary
762 * for click-create-vertex.
763 */
765 /*opname*/ "create_vert",
766 /*slot_types_in*/
767 {
768 /* The coordinate of the new vert. */
769 {"co", BMO_OP_SLOT_VEC},
770 {{'\0'}},
771 },
772 /*slot_types_out*/
773 {
774 /* The new vert. */
775 {"vert.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
776 {{'\0'}},
777 },
778 /*init*/ nullptr,
779 /*exec*/ bmo_create_vert_exec,
780 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
781};
782
787 {0, nullptr},
788};
789
791 {CURVE_INTERP_CUBIC, "CUBIC"},
792 {CURVE_INTERP_LINEAR, "LINEAR"},
793 {0, nullptr},
794};
795
796/*
797 * Curve Edge Loops Between Selected.
798 *
799 * Fits the unselected edge loops to a curve defined by the selected vertices.
800 */
802 /*opname*/ "curve_edge_loops_between_selected",
803 /*slot_types_in*/
804 {
805 /* Input geometry. */
807 /* Influence factor: spans from 0.0 to 1.0. */
808 {"factor", BMO_OP_SLOT_FLT},
809 /* Restrictions on how the vertices can be moved. */
810 {"clamp_elevation",
814 /* Limits the tool to work within the boundaries of the selected vertices if false. */
815 {"extend_loop", BMO_OP_SLOT_BOOL},
816 /* Distribute vertices at constant distances along the curve. */
817 {"regular", BMO_OP_SLOT_BOOL},
818 /* Lock X axis editing. */
819 {"lock_x", BMO_OP_SLOT_BOOL},
820 /* Lock Y axis editing. */
821 {"lock_y", BMO_OP_SLOT_BOOL},
822 /* Lock Z axis editing. */
823 {"lock_z", BMO_OP_SLOT_BOOL},
824 /* Method used for interpolation. */
825 {"interpolation",
829 {{'\0'}},
830 },
831 /*slot_types_out*/
832 {{{'\0'}}},
833 /*init*/ nullptr,
835 /*type_flag*/
837};
838
839/*
840 * Join Triangles.
841 *
842 * Tries to intelligently join triangles according
843 * to angle threshold and delimiters.
844 */
845
846#if 0 /* See comments at top of bmo_join_triangles.cc */
847# define USE_JOIN_TRIANGLE_INTERACTIVE_TESTING
848#endif
849
851 /*opname*/ "join_triangles",
852 /*slot_types_in*/
853 {
854 /* Input geometry. */
855 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
856 /* Compare seam */
857 {"cmp_seam", BMO_OP_SLOT_BOOL},
858 /* Compare sharp */
859 {"cmp_sharp", BMO_OP_SLOT_BOOL},
860 /* Compare UVs */
861 {"cmp_uvs", BMO_OP_SLOT_BOOL},
862 /* Compare VCols. */
863 {"cmp_vcols", BMO_OP_SLOT_BOOL},
864 /* Compare materials. */
865 {"cmp_materials", BMO_OP_SLOT_BOOL},
866 {"angle_face_threshold", BMO_OP_SLOT_FLT},
867 {"angle_shape_threshold", BMO_OP_SLOT_FLT},
868 {"topology_influence", BMO_OP_SLOT_FLT},
869 {"deselect_joined", BMO_OP_SLOT_BOOL},
870#ifdef USE_JOIN_TRIANGLE_INTERACTIVE_TESTING
871 {"merge_limit", BMO_OP_SLOT_INT},
872 {"neighbor_debug", BMO_OP_SLOT_INT},
873#endif
874 {{'\0'}},
875 },
876 /*slot_types_out*/
877 {
878 /* Joined faces. */
879 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
880 {{'\0'}},
881 },
882 /*init*/ nullptr,
884 /*type_flag*/
887};
888
889/*
890 * Contextual Create.
891 *
892 * This is basically F-key, it creates
893 * new faces from vertices, makes stuff from edge nets,
894 * makes wire edges, etc. It also dissolves faces.
895 *
896 * Three verts become a triangle, four become a quad. Two
897 * become a wire edge.
898 */
900 /*opname*/ "contextual_create",
901 /*slot_types_in*/
902 {
903 /* Input geometry. */
905 /* Material to use. */
906 {"mat_nr", BMO_OP_SLOT_INT},
907 /* Set smooth shading on newly created faces. */
908 {"use_smooth", BMO_OP_SLOT_BOOL},
909 {{'\0'}},
910 },
911 /*slot_types_out*/
912 {
913 /* Newly-made face(s). */
914 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
915
916 /* NOTE: this is for stand-alone edges only,
917 * not edges which are a part of newly created faces. */
918
919 /* Newly-made edge(s). */
920 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
921 {{'\0'}},
922 },
923 /*init*/ nullptr,
925 /*type_flag*/
928};
929
930/*
931 * Bridge edge loops with faces.
932 */
934 /*opname*/ "bridge_loops",
935 /*slot_types_in*/
936 {
937 /* Input edges. */
938 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
939 {"use_pairs", BMO_OP_SLOT_BOOL},
940 {"use_cyclic", BMO_OP_SLOT_BOOL},
941 /* Merge rather than creating faces. */
942 {"use_merge", BMO_OP_SLOT_BOOL},
943 /* Merge factor. */
944 {"merge_factor", BMO_OP_SLOT_FLT},
945 /* Twist offset for closed loops. */
946 {"twist_offset", BMO_OP_SLOT_INT},
947 {{'\0'}},
948 },
949 /*slot_types_out*/
950 {
951 /* New faces. */
952 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
953 /* New edges. */
954 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
955 {{'\0'}},
956 },
957 /*init*/ nullptr,
958 /*exec*/ bmo_bridge_loops_exec,
959 /*type_flag*/
962};
963
964/*
965 * Grid Fill.
966 *
967 * Create faces defined by 2 disconnected edge loops (which share edges).
968 */
970 /*opname*/ "grid_fill",
971 /*slot_types_in*/
972 {
973 /* Input edges. */
974 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
975
976 /* Restricts edges to groups. maps edges to integer. */
977
978 /* Material to use. */
979 {"mat_nr", BMO_OP_SLOT_INT},
980 /* Smooth state to use. */
981 {"use_smooth", BMO_OP_SLOT_BOOL},
982 /* Use simple interpolation. */
983 {"use_interp_simple", BMO_OP_SLOT_BOOL},
984 {{'\0'}},
985 },
986
987 /*slot_types_out*/
988 {
989 /* New faces. */
990 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
991 {{'\0'}},
992 },
993 /*init*/ nullptr,
994 /*exec*/ bmo_grid_fill_exec,
996};
997
998/*
999 * Fill Holes.
1000 *
1001 * Fill boundary edges with faces, copying surrounding custom-data.
1002 */
1004 /*opname*/ "holes_fill",
1005 /*slot_types_in*/
1006 {
1007 /* Input edges. */
1008 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1009 /* Maximum number of sides for holes to fill, zero fills all holes. */
1010 {"sides", BMO_OP_SLOT_INT},
1011 {{'\0'}},
1012 },
1013 /*slot_types_out*/
1014 {
1015 /* New faces. */
1016 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1017 {{'\0'}},
1018 },
1019 /*init*/ nullptr,
1020 /*exec*/ bmo_holes_fill_exec,
1022};
1023
1024/*
1025 * Face Attribute Fill.
1026 *
1027 * Fill in faces with data from adjacent faces.
1028 */
1030 /*opname*/ "face_attribute_fill",
1031 /*slot_types_in*/
1032 {
1033 /* Input faces. */
1034 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1035 /* Copy face winding. */
1036 {"use_normals", BMO_OP_SLOT_BOOL},
1037 /* Copy face data. */
1038 {"use_data", BMO_OP_SLOT_BOOL},
1039 {{'\0'}},
1040 },
1041 /*slot_types_out*/
1042 {
1043 /* Faces that could not be handled. */
1044 {"faces_fail.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1045 {{'\0'}},
1046 },
1047 /*init*/ nullptr,
1049 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1050};
1051
1052/*
1053 * Edge Loop Fill.
1054 *
1055 * Create faces defined by one or more non overlapping edge loops.
1056 */
1058 /*opname*/ "edgeloop_fill",
1059 /*slot_types_in*/
1060 {
1061 /* Input edges. */
1062 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1063
1064 /* Restricts edges to groups. maps edges to integer. */
1065
1066 /* Material to use. */
1067 {"mat_nr", BMO_OP_SLOT_INT},
1068 /* Smooth state to use. */
1069 {"use_smooth", BMO_OP_SLOT_BOOL},
1070 {{'\0'}},
1071 },
1072 /*slot_types_out*/
1073 {
1074 /* New faces. */
1075 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1076 {{'\0'}},
1077 },
1078 /*init*/ nullptr,
1079 /*exec*/ bmo_edgeloop_fill_exec,
1081};
1082
1083/*
1084 * Edge Net Fill.
1085 *
1086 * Create faces defined by enclosed edges.
1087 */
1089 /*opname*/ "edgenet_fill",
1090 /*slot_types_in*/
1091 {
1092 /* Input edges. */
1093 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1094 /* Material to use. */
1095 {"mat_nr", BMO_OP_SLOT_INT},
1096 /* Smooth state to use. */
1097 {"use_smooth", BMO_OP_SLOT_BOOL},
1098 /* Maximum number of sides for created faces (currently ignored). */
1099 {"sides", BMO_OP_SLOT_INT},
1100 {{'\0'}},
1101 },
1102 /*slot_types_out*/
1103 {
1104 /* New faces. */
1105 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1106 {{'\0'}},
1107 },
1108 /*init*/ nullptr,
1109 /*exec*/ bmo_edgenet_fill_exec,
1111};
1112
1113/*
1114 * Edge-net Prepare.
1115 *
1116 * Identifies several useful edge loop cases and modifies them so
1117 * they'll become a face when edgenet_fill is called. The cases covered are:
1118 *
1119 * - One single loop; an edge is added to connect the ends
1120 * - Two loops; two edges are added to connect the endpoints (based on the
1121 * shortest distance between each endpoint).
1122 */
1124 /*opname*/ "edgenet_prepare",
1125 /*slot_types_in*/
1126 {
1127 /* Input edges. */
1128 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1129 {{'\0'}},
1130 },
1131 /*slot_types_out*/
1132 {
1133 /* New edges. */
1134 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1135 {{'\0'}},
1136 },
1137 /*init*/ nullptr,
1138 /*exec*/ bmo_edgenet_prepare_exec,
1139 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
1140};
1141
1142/*
1143 * Rotate.
1144 *
1145 * Rotate vertices around a center, using a 3x3 rotation matrix.
1146 */
1148 /*opname*/ "rotate",
1149 /*slot_types_in*/
1150 {
1151 /* Center of rotation. */
1152 {"cent", BMO_OP_SLOT_VEC},
1153 /* Matrix defining rotation. */
1154 {"matrix", BMO_OP_SLOT_MAT},
1155 /* Input vertices. */
1156 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1157 /* Matrix to define the space (typically object matrix). */
1158 {"space", BMO_OP_SLOT_MAT},
1159 /* Transform shape keys too. */
1160 {"use_shapekey", BMO_OP_SLOT_BOOL},
1161 {{'\0'}},
1162 },
1163 /*slot_types_out*/
1164 {{{'\0'}}},
1165 /*init*/ nullptr,
1166 /*exec*/ bmo_rotate_exec,
1167 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1168};
1169
1170/*
1171 * Translate.
1172 *
1173 * Translate vertices by an offset.
1174 */
1176 /*opname*/ "translate",
1177 /*slot_types_in*/
1178 {
1179 /* Translation offset. */
1180 {"vec", BMO_OP_SLOT_VEC},
1181 /* Matrix to define the space (typically object matrix). */
1182 {"space", BMO_OP_SLOT_MAT},
1183 /* Input vertices. */
1184 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1185 /* Transform shape keys too. */
1186 {"use_shapekey", BMO_OP_SLOT_BOOL},
1187 {{'\0'}},
1188 },
1189 /*slot_types_out*/
1190 {{{'\0'}}},
1191 /*init*/ nullptr,
1192 /*exec*/ bmo_translate_exec,
1193 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1194};
1195
1196/*
1197 * Scale.
1198 *
1199 * Scales vertices by a factor.
1200 */
1202 /*opname*/ "scale",
1203 /*slot_types_in*/
1204 {
1205 /* Scale factor. */
1206 {"vec", BMO_OP_SLOT_VEC},
1207 /* Matrix to define the space (typically object matrix). */
1208 {"space", BMO_OP_SLOT_MAT},
1209 /* Input vertices. */
1210 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1211 /* Transform shape keys too. */
1212 {"use_shapekey", BMO_OP_SLOT_BOOL},
1213 {{'\0'}},
1214 },
1215 /*slot_types_out*/
1216 {{{'\0'}}},
1217 /*init*/ nullptr,
1218 /*exec*/ bmo_scale_exec,
1219 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1220};
1221
1223 {TO_ANNOTATION_SPREAD, "SPREAD"},
1224 {TO_ANNOTATION_SPREAD_EVENLY, "SPREAD_EVENLY"},
1225 {TO_ANNOTATION_PROJECT, "PROJECT"},
1226 {0, nullptr}};
1227
1228/*
1229 * Fit Edge Loops To Annotation.
1230 *
1231 * Stretches selected vertices to the active stroke.
1232 */
1234 /*opname*/ "fit_edge_loops_to_annotation",
1235 /*slot_types_in*/
1236 {
1237 /* Input geometry. */
1238 {"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1239 /* Influence factor: spans from 0.0 to 1.0. */
1240 {"factor", BMO_OP_SLOT_FLT},
1241 /* Method of distributing the vertices over the stroke. */
1242 {"method",
1246 /* Array of annotation strokes to project onto (ignored if None). */
1248 /* Lock X axis editing. */
1249 {"lock_x", BMO_OP_SLOT_BOOL},
1250 /* Lock Y axis editing. */
1251 {"lock_y", BMO_OP_SLOT_BOOL},
1252 /* Lock Z axis editing. */
1253 {"lock_z", BMO_OP_SLOT_BOOL},
1254 {{'\0'}},
1255 },
1256 /*slot_types_out*/
1257 {{{'\0'}}},
1258 /*init*/ nullptr,
1260 /*type_flag*/
1262};
1263
1264/*
1265 * Transform.
1266 *
1267 * Transforms a set of vertices by a matrix. Multiplies
1268 * the vertex coordinates with the matrix.
1269 */
1271 /*opname*/ "transform",
1272 /*slot_types_in*/
1273 {
1274 /* Transform matrix. */
1275 {"matrix", BMO_OP_SLOT_MAT},
1276 /* Matrix to define the space (typically object matrix). */
1277 {"space", BMO_OP_SLOT_MAT},
1278 /* Input vertices. */
1279 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1280 /* Transform shape keys too. */
1281 {"use_shapekey", BMO_OP_SLOT_BOOL},
1282 {{'\0'}},
1283 },
1284 /*slot_types_out*/
1285 {{{'\0'}}},
1286 /*init*/ nullptr,
1287 /*exec*/ bmo_transform_exec,
1288 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1289};
1290
1291/*
1292 * Object Load BMesh.
1293 *
1294 * Loads a bmesh into an object/mesh. This is a "private"
1295 * BMOP.
1296 */
1298 /*opname*/ "object_load_bmesh",
1299 /*slot_types_in*/
1300 {
1301 /* The scene. */
1303
1304 /* The object. */
1306 {{'\0'}},
1307 },
1308 /*slot_types_out*/
1309 {{{'\0'}}},
1310 /*init*/ nullptr,
1312 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
1313};
1314
1315/*
1316 * BMesh to Mesh.
1317 *
1318 * Converts a bmesh to a Mesh. This is reserved for exiting edit-mode.
1319 */
1321 /*opname*/ "bmesh_to_mesh",
1322 /*slot_types_in*/
1323 {
1324
1325 /* The mesh to write into. */
1327 /* The object. */
1329 {{'\0'}},
1330 },
1331 /*slot_types_out*/
1332 {{{'\0'}}},
1333 /*init*/ nullptr,
1334 /*exec*/ bmo_bmesh_to_mesh_exec,
1335 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
1336};
1337
1338/*
1339 * Mesh to BMesh.
1340 *
1341 * Load the contents of a mesh into the bmesh. this BMOP is private, it's
1342 * reserved exclusively for entering edit-mode.
1343 */
1345 /*opname*/ "mesh_to_bmesh",
1346 /*slot_types_in*/
1347 {
1348 /* The mesh to read from. */
1350 /* The object. */
1352 /* Load active shapekey coordinates into verts. */
1353 {"use_shapekey", BMO_OP_SLOT_BOOL},
1354 {{'\0'}},
1355 },
1356 /*slot_types_out*/
1357 {{{'\0'}}},
1358 /*init*/ nullptr,
1359 /*exec*/ bmo_mesh_to_bmesh_exec,
1360 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
1361};
1362
1363/*
1364 * Individual Face Extrude.
1365 *
1366 * Extrudes faces individually.
1367 */
1369 /*opname*/ "extrude_discrete_faces",
1370 /*slot_types_in*/
1371 {
1372 /* Input faces. */
1373 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1374 /* Create faces with reversed direction. */
1375 {"use_normal_flip", BMO_OP_SLOT_BOOL},
1376 /* Preserve the selection history in the extruded geometry. */
1377 {"use_select_history", BMO_OP_SLOT_BOOL},
1378 {{'\0'}},
1379 },
1380 /*slot_types_out*/
1381 {
1382 /* Output faces. */
1383 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1384 {{'\0'}},
1385 },
1386 /*init*/ nullptr,
1388 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1389};
1390
1391/*
1392 * Extrude Only Edges.
1393 *
1394 * Extrudes Edges into faces, note that this is very simple, there's no fancy
1395 * winged extrusion.
1396 */
1398 /*opname*/ "extrude_edge_only",
1399 /*slot_types_in*/
1400 {
1401 /* Input edges. */
1402 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1403 /* Create faces with reversed direction. */
1404 {"use_normal_flip", BMO_OP_SLOT_BOOL},
1405 /* Preserve the selection history in the extruded geometry. */
1406 {"use_select_history", BMO_OP_SLOT_BOOL},
1407 {{'\0'}},
1408 },
1409 /*slot_types_out*/
1410 {
1411 /* Output geometry. */
1412 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1413 {{'\0'}},
1414 },
1415 /*init*/ nullptr,
1417 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1418};
1419
1420/*
1421 * Individual Vertex Extrude.
1422 *
1423 * Extrudes individual vertices, creating new vertices connected by wire edges.
1424 */
1426 /*opname*/ "extrude_vert_indiv",
1427 /*slot_types_in*/
1428 {
1429 /* Input vertices. */
1430 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1431 /* Preserve the selection history in the extruded geometry. */
1432 {"use_select_history", BMO_OP_SLOT_BOOL},
1433 {{'\0'}},
1434 },
1435 /*slot_types_out*/
1436 {
1437 /* Output wire edges. */
1438 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1439 /* Output vertices. */
1440 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1441 {{'\0'}},
1442 },
1443 /*init*/ nullptr,
1445 /*type_flag*/ (BMO_OPTYPE_FLAG_SELECT_FLUSH),
1446};
1447
1448/*
1449 * Connect Verts.
1450 *
1451 * Split faces by adding edges that connect `verts`.
1452 */
1454 /*opname*/ "connect_verts",
1455 /*slot_types_in*/
1456 {
1457 /* Input vertices. */
1458 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1459 /* Input faces to explicitly exclude from connecting. */
1460 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1461 /* Prevent splits with overlaps & intersections. */
1462 {"check_degenerate", BMO_OP_SLOT_BOOL},
1463 {{'\0'}},
1464 },
1465 /*slot_types_out*/
1466 {
1467 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1468 {{'\0'}},
1469 },
1470 /*init*/ nullptr,
1471 /*exec*/ bmo_connect_verts_exec,
1472 /*type_flag*/
1474};
1475
1476/*
1477 * Connect Verts to form Convex Faces.
1478 *
1479 * Splits concave faces into convex faces.
1480 */
1482 /*opname*/ "connect_verts_concave",
1483 /*slot_types_in*/
1484 {
1485 /* Input faces. */
1486 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1487 {{'\0'}},
1488 },
1489 /*slot_types_out*/
1490 {
1491 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1492 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1493 {{'\0'}},
1494 },
1495 /*init*/ nullptr,
1497 /*type_flag*/
1499};
1500
1501/*
1502 * Connect Verts Across non Planar Faces.
1503 *
1504 * Split faces by connecting edges along non planar `faces`.
1505 */
1507 /*opname*/ "connect_verts_nonplanar",
1508 /*slot_types_in*/
1509 {
1510 /* Maximum angle of non-planarity before splitting (radians). */
1511 {"angle_limit", BMO_OP_SLOT_FLT},
1512 /* Input faces. */
1513 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1514 {{'\0'}},
1515 },
1516 /*slot_types_out*/
1517 {
1518 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1519 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1520 {{'\0'}},
1521 },
1522 /*init*/ nullptr,
1524 /*type_flag*/
1526};
1527
1528/*
1529 * Connect Vert Pair.
1530 *
1531 * Connect a pair of vertices by splitting faces along the shortest path between them.
1532 */
1534 /*opname*/ "connect_vert_pair",
1535 /*slot_types_in*/
1536 {
1537 /* Input vertices. */
1538 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1539 /* Input vertices to explicitly exclude from connecting. */
1540 {"verts_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1541 /* Input faces to explicitly exclude from connecting. */
1542 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1543 {{'\0'}},
1544 },
1545 /*slot_types_out*/
1546 {
1547 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1548 {{'\0'}},
1549 },
1550 /*init*/ nullptr,
1552 /*type_flag*/
1554};
1555
1556/*
1557 * Extrude Faces.
1558 *
1559 * Extrude operator (does not transform)
1560 */
1562 /*opname*/ "extrude_face_region",
1563 /*slot_types_in*/
1564 {
1565 /* Edges and faces. */
1567 /* Input edges to explicitly exclude from extrusion. */
1569 /* Keep original geometry (requires `geom` to include edges). */
1570 {"use_keep_orig", BMO_OP_SLOT_BOOL},
1571 /* Create faces with reversed direction. */
1572 {"use_normal_flip", BMO_OP_SLOT_BOOL},
1573 /* Use winding from surrounding faces instead of this region. */
1574 {"use_normal_from_adjacent", BMO_OP_SLOT_BOOL},
1575 /* Dissolve edges whose faces form a flat surface. */
1576 {"use_dissolve_ortho_edges", BMO_OP_SLOT_BOOL},
1577 /* Preserve the selection history in the extruded geometry. */
1578 {"use_select_history", BMO_OP_SLOT_BOOL},
1579 /* Skip flipping of input faces to preserve original orientation. */
1580 {"skip_input_flip", BMO_OP_SLOT_BOOL},
1581 {{'\0'}},
1582 },
1583 /*slot_types_out*/
1584 {
1585 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1586 {{'\0'}},
1587 },
1588 /*init*/ nullptr,
1590 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
1591};
1592
1593/*
1594 * Dissolve Verts.
1595 */
1597 /*opname*/ "dissolve_verts",
1598 /*slot_types_in*/
1599 {
1600 /* Input vertices. */
1601 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1602 /* Split off face corners to maintain surrounding geometry. */
1603 {"use_face_split", BMO_OP_SLOT_BOOL},
1604 /* Split off face corners instead of merging faces. */
1605 {"use_boundary_tear", BMO_OP_SLOT_BOOL},
1606 {{'\0'}},
1607 },
1608 /*slot_types_out*/
1609 {{{'\0'}}},
1610 /*init*/ nullptr,
1611 /*exec*/ bmo_dissolve_verts_exec,
1612 /*type_flag*/
1615};
1616
1617/*
1618 * Dissolve Edges.
1619 */
1621 /*opname*/ "dissolve_edges",
1622 /*slot_types_in*/
1623 {
1624 /* Input edges. */
1625 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1626 /* Dissolve verts left between only 2 edges. */
1627 {"use_verts", BMO_OP_SLOT_BOOL},
1628 /* Split off face corners to maintain surrounding geometry. */
1629 {"use_face_split", BMO_OP_SLOT_BOOL},
1630 /* Do not dissolve verts between 2 edges when their angle exceeds this threshold.
1631 * Disabled by default. */
1632 {"angle_threshold", BMO_OP_SLOT_FLT},
1633 /* When dissolving the edge between 2 triangles, don't dissolve the verts. */
1634 {"use_preserve_quads", BMO_OP_SLOT_BOOL},
1635 {{'\0'}},
1636 },
1637 /*slot_types_out*/
1638 {
1639 {"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1640 {{'\0'}},
1641 },
1642 /*init*/ bmo_dissolve_edges_init,
1643 /*exec*/ bmo_dissolve_edges_exec,
1644 /*type_flag*/
1647};
1648
1649/*
1650 * Dissolve Faces.
1651 */
1653 /*opname*/ "dissolve_faces",
1654 /*slot_types_in*/
1655 {
1656 /* Input faces. */
1657 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1658 /* Dissolve verts left between only 2 edges. */
1659 {"use_verts", BMO_OP_SLOT_BOOL},
1660 {{'\0'}},
1661 },
1662 /*slot_types_out*/
1663 {
1664 {"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1665 {{'\0'}},
1666 },
1667 /*init*/ nullptr,
1668 /*exec*/ bmo_dissolve_faces_exec,
1669 /*type_flag*/
1672};
1673
1675 {BMO_DELIM_NORMAL, "NORMAL"},
1676 {BMO_DELIM_MATERIAL, "MATERIAL"},
1677 {BMO_DELIM_SEAM, "SEAM"},
1678 {BMO_DELIM_SHARP, "SHARP"},
1679 {BMO_DELIM_UV, "UV"},
1680 {0, nullptr},
1681};
1682
1683/*
1684 * Limited Dissolve.
1685 *
1686 * Dissolve planar faces and co-linear edges.
1687 */
1689 /*opname*/ "dissolve_limit",
1690 /*slot_types_in*/
1691 {
1692 /* Maximum angle (radians) between face normals for dissolving. */
1693 {"angle_limit", BMO_OP_SLOT_FLT},
1694 /* Dissolve all vertices in between face boundaries. */
1695 {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL},
1696 /* Input vertices. */
1697 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1698 /* Input edges. */
1699 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1700 /* Delimit dissolve operation. */
1701 {"delimit",
1705 {{'\0'}},
1706 },
1707 /*slot_types_out*/
1708 {
1709 {"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1710 {{'\0'}},
1711 },
1712 /*init*/ nullptr,
1713 /*exec*/ bmo_dissolve_limit_exec,
1714 /*type_flag*/
1717};
1718
1719/*
1720 * Degenerate Dissolve.
1721 *
1722 * Dissolve edges with no length, faces with no area.
1723 */
1725 /*opname*/ "dissolve_degenerate",
1726 /*slot_types_in*/
1727 {
1728 /* Maximum distance to consider degenerate. */
1729 {"dist", BMO_OP_SLOT_FLT},
1730 /* Input edges. */
1731 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1732 {{'\0'}},
1733 },
1734 /*slot_types_out*/
1735 {{{'\0'}}},
1736 /*init*/ nullptr,
1738 /*type_flag*/
1741};
1742
1744 {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY"},
1745 {MOD_TRIANGULATE_QUAD_FIXED, "FIXED"},
1746 {MOD_TRIANGULATE_QUAD_ALTERNATE, "ALTERNATE"},
1747 {MOD_TRIANGULATE_QUAD_SHORTEDGE, "SHORT_EDGE"},
1748 {MOD_TRIANGULATE_QUAD_LONGEDGE, "LONG_EDGE"},
1749 {0, nullptr},
1750};
1751
1753 {MOD_TRIANGULATE_NGON_BEAUTY, "BEAUTY"},
1754 {MOD_TRIANGULATE_NGON_EARCLIP, "EAR_CLIP"},
1755 {0, nullptr},
1756};
1757
1758/*
1759 * Triangulate.
1760 *
1761 * Triangulate faces, splitting quads and n-gons into triangles.
1762 */
1764 /*opname*/ "triangulate",
1765 /*slot_types_in*/
1766 {
1767 /* Input faces. */
1768 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1769 /* Method for splitting the quads into triangles. */
1770 {"quad_method",
1774 /* Method for splitting the polygons into triangles. */
1775 {"ngon_method",
1779 {{'\0'}},
1780 },
1781 /*slot_types_out*/
1782 {
1783 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1784 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1785 {"face_map.out",
1788 /* Duplicate faces. */
1789 {"face_map_double.out",
1792 {{'\0'}},
1793 },
1794 /*init*/ nullptr,
1795 /*exec*/ bmo_triangulate_exec,
1796 /*type_flag*/
1798};
1799
1800/*
1801 * Un-Subdivide.
1802 *
1803 * Reduce detail in geometry containing grids.
1804 */
1806 /*opname*/ "unsubdivide",
1807 /*slot_types_in*/
1808 {
1809 /* Input vertices. */
1810 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
1811 /* Number of times to unsubdivide. */
1812 {"iterations", BMO_OP_SLOT_INT},
1813 {{'\0'}},
1814 },
1815 /*slot_types_out*/
1816 {{{'\0'}}},
1817 /*init*/ nullptr,
1818 /*exec*/ bmo_unsubdivide_exec,
1819 /*type_flag*/
1822};
1823
1825 {SUBD_CORNER_STRAIGHT_CUT, "STRAIGHT_CUT"},
1826 {SUBD_CORNER_INNERVERT, "INNER_VERT"},
1827 {SUBD_CORNER_PATH, "PATH"},
1828 {SUBD_CORNER_FAN, "FAN"},
1829 {0, nullptr},
1830};
1831
1832/*
1833 * Subdivide Edges.
1834 *
1835 * Advanced operator for subdividing edges
1836 * with options for face patterns, smoothing and randomization.
1837 */
1839 /*opname*/ "subdivide_edges",
1840 /*slot_types_in*/
1841 {
1842 /* Input edges. */
1843 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1844 /* Smoothness factor. */
1845 {"smooth", BMO_OP_SLOT_FLT},
1846 /* Smooth falloff type. */
1847 {"smooth_falloff",
1851 /* Fractal randomness factor. */
1852 {"fractal", BMO_OP_SLOT_FLT},
1853 /* Factor (0 to 1) controlling how much fractal displacement is restricted to the normal.
1854 */
1855 {"along_normal", BMO_OP_SLOT_FLT},
1856 /* Number of cuts. */
1857 {"cuts", BMO_OP_SLOT_INT},
1858 /* Seed for the random number generator. */
1859 {"seed", BMO_OP_SLOT_INT},
1860 /* Internal use only, not accessible from Python. */
1861 {"custom_patterns",
1864 /* Mapping of edges to a float (0 to 1) controlling the cut position along each edge. */
1866 /* Quad corner type. */
1867 {"quad_corner_type",
1871 /* Fill in fully-selected faces with a grid. */
1872 {"use_grid_fill", BMO_OP_SLOT_BOOL},
1873 /* Tessellate the case of one edge selected in a quad or triangle. */
1874 {"use_single_edge", BMO_OP_SLOT_BOOL},
1875 /* Only subdivide quads (for loop-cut). */
1876 {"use_only_quads", BMO_OP_SLOT_BOOL},
1877 /* Project new vertices onto a sphere (used for spherical primitives). */
1878 {"use_sphere", BMO_OP_SLOT_BOOL},
1879 /* Maintain even offset when smoothing. */
1880 {"use_smooth_even", BMO_OP_SLOT_BOOL},
1881 {{'\0'}},
1882 },
1883 /*slot_types_out*/
1884 {
1885 /* NOTE: these next three can have multiple types of elements in them. */
1886 {"geom_inner.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1887 {"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1888 /* Contains all output geometry. */
1889 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1890 {{'\0'}},
1891 },
1892 /*init*/ nullptr,
1893 /*exec*/ bmo_subdivide_edges_exec,
1894 /*type_flag*/
1897};
1898
1900 {SUBD_RING_INTERP_LINEAR, "LINEAR"},
1901 {SUBD_RING_INTERP_PATH, "PATH"},
1902 {SUBD_RING_INTERP_SURF, "SURFACE"},
1903 {0, nullptr},
1904};
1905
1906/*
1907 * Subdivide Edge-Ring.
1908 *
1909 * Take an edge-ring, and subdivide with interpolation options.
1910 */
1912 /*opname*/ "subdivide_edgering",
1913 /*slot_types_in*/
1914 {
1915 /* Input edges. */
1916 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
1917 /* Interpolation method. */
1918 {"interp_mode",
1922 /* Smoothness factor. */
1923 {"smooth", BMO_OP_SLOT_FLT},
1924 /* Number of cuts. */
1925 {"cuts", BMO_OP_SLOT_INT},
1926 /* Profile shape type. */
1927 {"profile_shape",
1931 /* How much intermediary new edges are shrunk/expanded. */
1932 {"profile_shape_factor", BMO_OP_SLOT_FLT},
1933 {{'\0'}},
1934 },
1935 /*slot_types_out*/
1936 {
1937 /* Output faces. */
1938 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
1939 {{'\0'}},
1940 },
1941 /*init*/ nullptr,
1943 /*type_flag*/
1946};
1947
1948/*
1949 * Bisect Plane.
1950 *
1951 * Bisects the mesh by a plane (cut the mesh in half).
1952 */
1954 /*opname*/ "bisect_plane",
1955 /*slot_types_in*/
1956 {
1957 /* Input geometry. */
1959 /* Minimum distance when testing if a vert is exactly on the plane. */
1960 {"dist", BMO_OP_SLOT_FLT},
1961 /* Point on the plane. */
1962 {"plane_co", BMO_OP_SLOT_VEC},
1963 /* Normal of the plane. */
1964 {"plane_no", BMO_OP_SLOT_VEC},
1965 /* Snap axis aligned verts to the center. */
1966 {"use_snap_center", BMO_OP_SLOT_BOOL},
1967 /* When enabled, remove all geometry on the positive side of the plane. */
1968 {"clear_outer", BMO_OP_SLOT_BOOL},
1969 /* When enabled, remove all geometry on the negative side of the plane. */
1970 {"clear_inner", BMO_OP_SLOT_BOOL},
1971 {{'\0'}},
1972 },
1973 /*slot_types_out*/
1974 {
1975 /* Output geometry aligned with the plane (new and existing). */
1976 {"geom_cut.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE}},
1977 /* Input and output geometry (result of cut). */
1978 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
1979 {{'\0'}},
1980 },
1981 /*init*/ nullptr,
1982 /*exec*/ bmo_bisect_plane_exec,
1983 /*type_flag*/
1986};
1987
1989 {DEL_VERTS, "VERTS"},
1990 {DEL_EDGES, "EDGES"},
1991 {DEL_ONLYFACES, "FACES_ONLY"},
1992 {DEL_EDGESFACES, "EDGES_FACES"},
1993 {DEL_FACES, "FACES"},
1994 {DEL_FACES_KEEP_BOUNDARY, "FACES_KEEP_BOUNDARY"},
1995 {DEL_ONLYTAGGED, "TAGGED_ONLY"},
1996 {0, nullptr},
1997};
1998
1999/*
2000 * Delete Geometry.
2001 *
2002 * Utility operator to delete geometry.
2003 */
2005 /*opname*/ "delete",
2006 /*slot_types_in*/
2007 {
2008 /* Input geometry. */
2010 /* Geometry types to delete. */
2011 {"context",
2015 {{'\0'}},
2016 },
2017 /*slot_types_out*/
2018 {{{'\0'}}},
2019 /*init*/ nullptr,
2020 /*exec*/ bmo_delete_exec,
2021 /*type_flag*/
2024};
2025
2026/*
2027 * Duplicate Geometry.
2028 *
2029 * Utility operator to duplicate geometry,
2030 * optionally into a destination mesh.
2031 */
2033 /*opname*/ "duplicate",
2034 /*slot_types_in*/
2035 {
2036 /* Input geometry. */
2038 /* Destination bmesh, if None will use current one. */
2040 /* Preserve the selection history in the duplicated geometry. */
2041 {"use_select_history", BMO_OP_SLOT_BOOL},
2042 /* Copy edge flip state from connected faces. */
2043 {"use_edge_flip_from_face", BMO_OP_SLOT_BOOL},
2044 {{'\0'}},
2045 },
2046 /*slot_types_out*/
2047 {
2048 {"geom_orig.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2049 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2050
2051 /* NOTE: face_map maps from source faces to dupe faces,
2052 * and from dupe faces to source faces. */
2053
2054 {"vert_map.out",
2057 {"edge_map.out",
2060 {"face_map.out",
2063 /* Boundary edges from the split geometry that maps edges from the original geometry
2064 * to the destination edges. */
2065 {"boundary_map.out",
2068 {"isovert_map.out",
2071 {{'\0'}},
2072 },
2073 /*init*/ nullptr,
2074 /*exec*/ bmo_duplicate_exec,
2076};
2077
2078/*
2079 * Split Off Geometry.
2080 *
2081 * Disconnect geometry from adjacent edges and faces,
2082 * optionally into a destination mesh.
2083 */
2085 /*opname*/ "split",
2086 /*slot_types_in*/
2087 {
2088 /* Input geometry. */
2090 /* Destination bmesh, if None will use current one. */
2092 /* When enabled, don't duplicate loose verts/edges. */
2093 {"use_only_faces", BMO_OP_SLOT_BOOL},
2094 {{'\0'}},
2095 },
2096 /*slot_types_out*/
2097 {
2098 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2099 /* Boundary edges from the split geometry that maps edges from the original geometry
2100 * to the destination edges.
2101 *
2102 * When the source edges have been deleted, the destination edge will be used
2103 * for both the key and the value. */
2104 {"boundary_map.out",
2107 {"isovert_map.out",
2110 {{'\0'}},
2111 },
2112 /*init*/ nullptr,
2113 /*exec*/ bmo_split_exec,
2115};
2116
2117/*
2118 * Spin.
2119 *
2120 * Extrude or duplicate geometry a number of times,
2121 * rotating and possibly translating after each step
2122 */
2124 /*opname*/ "spin",
2125 /*slot_types_in*/
2126 {
2127 /* Input geometry. */
2129 /* Rotation center. */
2130 {"cent", BMO_OP_SLOT_VEC},
2131 /* Rotation axis. */
2132 {"axis", BMO_OP_SLOT_VEC},
2133 /* Translation delta per step. */
2134 {"dvec", BMO_OP_SLOT_VEC},
2135 /* Total rotation angle (radians). */
2136 {"angle", BMO_OP_SLOT_FLT},
2137 /* Matrix to define the space (typically object matrix). */
2138 {"space", BMO_OP_SLOT_MAT},
2139 /* Number of steps. */
2140 {"steps", BMO_OP_SLOT_INT},
2141 /* Merge first/last when the angle is a full revolution. */
2142 {"use_merge", BMO_OP_SLOT_BOOL},
2143 /* Create faces with reversed direction. */
2144 {"use_normal_flip", BMO_OP_SLOT_BOOL},
2145 /* Duplicate the geometry, otherwise extrude. */
2146 {"use_duplicate", BMO_OP_SLOT_BOOL},
2147 {{'\0'}},
2148 },
2149 /*slot_types_out*/
2150 {
2151 /* Result of last step. */
2152 {"geom_last.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2153 {{'\0'}},
2154 },
2155 /*init*/ nullptr,
2156 /*exec*/ bmo_spin_exec,
2158};
2159
2160/*
2161 * UV Rotation.
2162 *
2163 * Cycle the loop UVs
2164 */
2166 /*opname*/ "rotate_uvs",
2167 /*slot_types_in*/
2168 {
2169 /* Input faces. */
2170 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2171 /* Rotate counter-clockwise if true, otherwise clockwise. */
2172 {"use_ccw", BMO_OP_SLOT_BOOL},
2173 {{'\0'}},
2174 },
2175 /*slot_types_out*/
2176 {{{'\0'}}},
2177 /*init*/ nullptr,
2178 /*exec*/ bmo_rotate_uvs_exec,
2179 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
2180};
2181
2182/*
2183 * UV Reverse.
2184 *
2185 * Reverse the UVs
2186 */
2188 /*opname*/ "reverse_uvs",
2189 /*slot_types_in*/
2190 {
2191 /* Input faces. */
2192 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2193 {{'\0'}},
2194 },
2195 /*slot_types_out*/
2196 {{{'\0'}}},
2197 /*init*/ nullptr,
2198 /*exec*/ bmo_reverse_uvs_exec,
2199 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
2200};
2201
2202/*
2203 * Color Rotation.
2204 *
2205 * Cycle the loop colors
2206 */
2208 /*opname*/ "rotate_colors",
2209 /*slot_types_in*/
2210 {
2211 /* Input faces. */
2212 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2213 /* Rotate counter-clockwise if true, otherwise clockwise. */
2214 {"use_ccw", BMO_OP_SLOT_BOOL},
2215 /* Index into color attribute list. */
2216 {"color_index", BMO_OP_SLOT_INT},
2217 {{'\0'}},
2218 },
2219 /*slot_types_out*/
2220 {{{'\0'}}},
2221 /*init*/ nullptr,
2222 /*exec*/ bmo_rotate_colors_exec,
2223 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
2224};
2225
2226/*
2227 * Color Reverse
2228 *
2229 * Reverse the loop colors.
2230 */
2232 /*opname*/ "reverse_colors",
2233 /*slot_types_in*/
2234 {
2235 /* Input faces. */
2236 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2237 /* Index into color attribute list. */
2238 {"color_index", BMO_OP_SLOT_INT},
2239 {{'\0'}},
2240 },
2241 /*slot_types_out*/
2242 {{{'\0'}}},
2243 /*init*/ nullptr,
2244 /*exec*/ bmo_reverse_colors_exec,
2245 /*type_flag*/ (BMO_OPTYPE_FLAG_NOP),
2246};
2247
2248/*
2249 * Edge Split.
2250 *
2251 * Disconnects faces along input edges.
2252 */
2254 /*opname*/ "split_edges",
2255 /*slot_types_in*/
2256 {
2257 /* Input edges. */
2258 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2259
2260 /* NOTE: needed for vertex rip so we can rip only half an edge
2261 * at a boundary which would otherwise split off. */
2262
2263 /* Optional tag verts, use to have greater control of splits. */
2264 {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2265 /* Use `verts` for splitting, else just find verts to split from edges. */
2266 {"use_verts", BMO_OP_SLOT_BOOL},
2267 {{'\0'}},
2268 },
2269 /*slot_types_out*/
2270 {
2271 /* The input edges and the new edges created by splitting them. */
2272 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2273 {{'\0'}},
2274 },
2275 /*init*/ nullptr,
2276 /*exec*/ bmo_split_edges_exec,
2277 /*type_flag*/
2279};
2280
2281/*
2282 * Create Grid.
2283 *
2284 * Creates a grid with a variable number of subdivisions
2285 */
2287 /*opname*/ "create_grid",
2288 /*slot_types_in*/
2289 {
2290 /* Number of x segments. */
2291 {"x_segments", BMO_OP_SLOT_INT},
2292 /* Number of y segments. */
2293 {"y_segments", BMO_OP_SLOT_INT},
2294 /* Size of the grid. */
2295 {"size", BMO_OP_SLOT_FLT},
2296 /* Matrix to multiply the new geometry with. */
2297 {"matrix", BMO_OP_SLOT_MAT},
2298 /* Calculate default UVs. */
2299 {"calc_uvs", BMO_OP_SLOT_BOOL},
2300 {{'\0'}},
2301 },
2302 /*slot_types_out*/
2303 {
2304 /* Output verts. */
2305 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2306 {{'\0'}},
2307 },
2308 /*init*/ nullptr,
2309 /*exec*/ bmo_create_grid_exec,
2311};
2312
2315 {QUADSPHERE_METHOD_EQUI_ANGULAR, "EVEN_ANGLE"},
2316 {0, nullptr},
2317};
2318
2319/*
2320 * Create Quad Sphere.
2321 *
2322 * Creates a sphere from a subdivided cube, made up entirely of quads.
2323 */
2325 /*opname*/ "create_quadsphere",
2326 /*slot_types_in*/
2327 {
2328 /* Number of quads along each edge of the cube the sphere is made from. */
2329 {"segments", BMO_OP_SLOT_INT},
2330 /* Mapping from the cube onto the sphere. */
2331 {"method",
2335 /* Radius. */
2336 {"radius", BMO_OP_SLOT_FLT},
2337 /* Matrix to multiply the new geometry with. */
2338 {"matrix", BMO_OP_SLOT_MAT},
2339 /* Calculate default UVs. */
2340 {"calc_uvs", BMO_OP_SLOT_BOOL},
2341 {{'\0'}},
2342 },
2343 /*slot_types_out*/
2344 {
2345 /* Output verts. */
2346 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2347 {{'\0'}},
2348 },
2349 /*init*/ nullptr,
2352};
2353
2354/*
2355 * Create UV Sphere.
2356 *
2357 * Creates a UV sphere with a variable number of subdivisions.
2358 */
2360 /*opname*/ "create_uvsphere",
2361 /*slot_types_in*/
2362 {
2363 /* Number of u segments. */
2364 {"u_segments", BMO_OP_SLOT_INT},
2365 /* Number of v segments. */
2366 {"v_segments", BMO_OP_SLOT_INT},
2367 /* Radius. */
2368 {"radius", BMO_OP_SLOT_FLT},
2369 /* Matrix to multiply the new geometry with. */
2370 {"matrix", BMO_OP_SLOT_MAT},
2371 /* Calculate default UVs. */
2372 {"calc_uvs", BMO_OP_SLOT_BOOL},
2373 {{'\0'}},
2374 },
2375 /*slot_types_out*/
2376 {
2377 /* Output verts. */
2378 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2379 {{'\0'}},
2380 },
2381 /*init*/ nullptr,
2382 /*exec*/ bmo_create_uvsphere_exec,
2384};
2385
2386/*
2387 * Create Ico-Sphere.
2388 *
2389 * Creates an ico-sphere with a variable number of subdivisions.
2390 */
2392 /*opname*/ "create_icosphere",
2393 /*slot_types_in*/
2394 {
2395 /* How many times to recursively subdivide the sphere. */
2396 {"subdivisions", BMO_OP_SLOT_INT},
2397 /* Radius. */
2398 {"radius", BMO_OP_SLOT_FLT},
2399 /* Matrix to multiply the new geometry with. */
2400 {"matrix", BMO_OP_SLOT_MAT},
2401 /* Calculate default UVs. */
2402 {"calc_uvs", BMO_OP_SLOT_BOOL},
2403 {{'\0'}},
2404 },
2405 /*slot_types_out*/
2406 {
2407 /* Output verts. */
2408 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2409 {{'\0'}},
2410 },
2411 /*init*/ nullptr,
2414};
2415
2416/*
2417 * Create Suzanne.
2418 *
2419 * Creates a monkey (standard blender primitive).
2420 */
2422 /*opname*/ "create_monkey",
2423 /*slot_types_in*/
2424 {
2425 /* Matrix to multiply the new geometry with. */
2426 {"matrix", BMO_OP_SLOT_MAT},
2427 /* Calculate default UVs. */
2428 {"calc_uvs", BMO_OP_SLOT_BOOL},
2429 {{'\0'}},
2430 },
2431 /*slot_types_out*/
2432 {
2433 /* Output verts. */
2434 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2435 {{'\0'}},
2436 },
2437 /*init*/ nullptr,
2438 /*exec*/ bmo_create_monkey_exec,
2440};
2441
2442/*
2443 * Create Cone.
2444 *
2445 * Creates a cone with variable radius at both ends
2446 */
2448 /*opname*/ "create_cone",
2449 /*slot_types_in*/
2450 {
2451 /* Whether or not to fill in the ends with faces. */
2452 {"cap_ends", BMO_OP_SLOT_BOOL},
2453 /* Fill ends with triangles instead of ngons. */
2454 {"cap_tris", BMO_OP_SLOT_BOOL},
2455 /* Number of vertices in the base circle. */
2456 {"segments", BMO_OP_SLOT_INT},
2457 /* Radius of one end. */
2458 {"radius1", BMO_OP_SLOT_FLT},
2459 /* Radius of the opposite end. */
2460 {"radius2", BMO_OP_SLOT_FLT},
2461 /* Distance between ends. */
2462 {"depth", BMO_OP_SLOT_FLT},
2463 /* Matrix to multiply the new geometry with. */
2464 {"matrix", BMO_OP_SLOT_MAT},
2465 /* Calculate default UVs. */
2466 {"calc_uvs", BMO_OP_SLOT_BOOL},
2467 {{'\0'}},
2468 },
2469 /*slot_types_out*/
2470 {
2471 /* Output verts. */
2472 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2473 {{'\0'}},
2474 },
2475 /*init*/ nullptr,
2476 /*exec*/ bmo_create_cone_exec,
2478};
2479
2480/*
2481 * Creates a Circle.
2482 */
2484 /*opname*/ "create_circle",
2485 /*slot_types_in*/
2486 {
2487 /* Whether or not to fill in the circle with a face. */
2488 {"cap_ends", BMO_OP_SLOT_BOOL},
2489 /* Fill the circle with triangles instead of an n-gon. */
2490 {"cap_tris", BMO_OP_SLOT_BOOL},
2491 /* Number of vertices in the circle. */
2492 {"segments", BMO_OP_SLOT_INT},
2493 /* Radius of the circle. */
2494 {"radius", BMO_OP_SLOT_FLT},
2495 /* Matrix to multiply the new geometry with. */
2496 {"matrix", BMO_OP_SLOT_MAT},
2497 /* Calculate default UVs. */
2498 {"calc_uvs", BMO_OP_SLOT_BOOL},
2499 {{'\0'}},
2500 },
2501 /*slot_types_out*/
2502 {
2503 /* Output verts. */
2504 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2505 {{'\0'}},
2506 },
2507 /*init*/ nullptr,
2508 /*exec*/ bmo_create_circle_exec,
2510};
2511
2512/*
2513 * Create Cube
2514 *
2515 * Creates a cube.
2516 */
2518 /*opname*/ "create_cube",
2519 /*slot_types_in*/
2520 {
2521 /* Size of the cube. */
2522 {"size", BMO_OP_SLOT_FLT},
2523 /* Matrix to multiply the new geometry with. */
2524 {"matrix", BMO_OP_SLOT_MAT},
2525 /* Calculate default UVs. */
2526 {"calc_uvs", BMO_OP_SLOT_BOOL},
2527 {{'\0'}},
2528 },
2529 /*slot_types_out*/
2530 {
2531 /* Output verts. */
2532 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2533 {{'\0'}},
2534 },
2535 /*init*/ nullptr,
2536 /*exec*/ bmo_create_cube_exec,
2538};
2539
2541 {BEVEL_AMT_OFFSET, "OFFSET"},
2542 {BEVEL_AMT_WIDTH, "WIDTH"},
2543 {BEVEL_AMT_DEPTH, "DEPTH"},
2544 {BEVEL_AMT_PERCENT, "PERCENT"},
2545 {BEVEL_AMT_ABSOLUTE, "ABSOLUTE"},
2546 {0, nullptr},
2547};
2548
2550 {BEVEL_PROFILE_SUPERELLIPSE, "SUPERELLIPSE"},
2551 {BEVEL_PROFILE_CUSTOM, "CUSTOM"},
2552 {0, nullptr},
2553};
2554
2556 {BEVEL_FACE_STRENGTH_NONE, "NONE"},
2557 {BEVEL_FACE_STRENGTH_NEW, "NEW"},
2558 {BEVEL_FACE_STRENGTH_AFFECTED, "AFFECTED"},
2559 {BEVEL_FACE_STRENGTH_ALL, "ALL"},
2560 {0, nullptr},
2561};
2562
2564 {BEVEL_MITER_SHARP, "SHARP"},
2565 {BEVEL_MITER_PATCH, "PATCH"},
2566 {BEVEL_MITER_ARC, "ARC"},
2567 {0, nullptr},
2568};
2569
2571 {BEVEL_VMESH_ADJ, "ADJ"},
2572 {BEVEL_VMESH_CUTOFF, "CUTOFF"},
2573 {0, nullptr},
2574};
2575
2577 {BEVEL_AFFECT_VERTICES, "VERTICES"},
2578 {BEVEL_AFFECT_EDGES, "EDGES"},
2579 {0, nullptr},
2580};
2581
2582/*
2583 * Bevel.
2584 *
2585 * Bevels edges and vertices
2586 */
2588 /*opname*/ "bevel",
2589 /*slot_types_in*/
2590 {
2591 /* Input edges and vertices. */
2593 /* Amount to offset beveled edge. */
2594 {"offset", BMO_OP_SLOT_FLT},
2595 /* How to measure the offset. */
2596 {"offset_type",
2600 /* The profile type to use for bevel. */
2601 {"profile_type",
2605 /* Number of segments in bevel. */
2606 {"segments", BMO_OP_SLOT_INT},
2607 /* Profile shape, 0->1 (.5=>round). */
2608 {"profile", BMO_OP_SLOT_FLT},
2609 /* Whether to bevel vertices or edges. */
2610 {"affect",
2614 /* Do not allow beveled edges/vertices to overlap each other. */
2615 {"clamp_overlap", BMO_OP_SLOT_BOOL},
2616 /* Material for bevel faces, -1 means get from adjacent faces. */
2617 {"material", BMO_OP_SLOT_INT},
2618 /* Prefer to slide along edges to having even widths. */
2619 {"loop_slide", BMO_OP_SLOT_BOOL},
2620 /* Extend edge data to allow seams to run across bevels. */
2621 {"mark_seam", BMO_OP_SLOT_BOOL},
2622 /* Extend edge data to allow sharp edges to run across bevels. */
2623 {"mark_sharp", BMO_OP_SLOT_BOOL},
2624 /* Harden normals. */
2625 {"harden_normals", BMO_OP_SLOT_BOOL},
2626 /* Whether to set face strength, and which faces to set if so. */
2627 {"face_strength_mode",
2631 /* Outer miter kind. */
2632 {"miter_outer",
2636 /* Inner miter kind. */
2637 {"miter_inner",
2641 /* Amount to spread the miter. */
2642 {"spread", BMO_OP_SLOT_FLT},
2643 /* CurveProfile, if None ignored */
2645 /* The method to use to create meshes at intersections. */
2646 {"vmesh_method",
2650 {{'\0'}},
2651 },
2652 /*slot_types_out*/
2653 {
2654 /* Output faces. */
2655 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2656 /* Output edges. */
2657 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2658 /* Output verts. */
2659 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2660 {{'\0'}},
2661 },
2662
2663 /*init*/ nullptr,
2664 /*exec*/ bmo_bevel_exec,
2665 /*type_flag*/
2668};
2669
2670/* No enum is defined for this. */
2672 {0, "AREA"},
2673 {1, "ANGLE"},
2674 {0, nullptr},
2675};
2676
2677/*
2678 * Beautify Fill.
2679 *
2680 * Rotate edges to create more evenly spaced triangles.
2681 */
2683 /*opname*/ "beautify_fill",
2684 /*slot_types_in*/
2685 {
2686 /* Input faces. */
2687 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2688 /* Edges that can be flipped. */
2689 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2690 /* Restrict edge rotation to mixed tagged vertices. */
2691 {"use_restrict_tag", BMO_OP_SLOT_BOOL},
2692 /* Method to define what is beautiful. */
2693 {"method",
2697 {{'\0'}},
2698 },
2699 /*slot_types_out*/
2700 {
2701 /* New flipped faces and edges. */
2702 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2703 {{'\0'}},
2704 },
2705 /*init*/ nullptr,
2706 /*exec*/ bmo_beautify_fill_exec,
2707 /*type_flag*/
2710};
2711
2712/*
2713 * Triangle Fill.
2714 *
2715 * Fill edges with triangles
2716 */
2718 /*opname*/ "triangle_fill",
2719 /*slot_types_in*/
2720 {
2721 /* Use best triangulation division. */
2722 {"use_beauty", BMO_OP_SLOT_BOOL},
2723 /* Dissolve resulting faces. */
2724 {"use_dissolve", BMO_OP_SLOT_BOOL},
2725 /* Input edges. */
2726 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2727 /* Optionally pass the fill normal to use. */
2728 {"normal", BMO_OP_SLOT_VEC},
2729 {{'\0'}},
2730 },
2731 /*slot_types_out*/
2732 {
2733 /* New faces and edges. */
2734 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2735 {{'\0'}},
2736 },
2737 /*init*/ nullptr,
2738 /*exec*/ bmo_triangle_fill_exec,
2739 /*type_flag*/
2741};
2742
2743/*
2744 * Solidify.
2745 *
2746 * Turns a mesh into a shell with thickness
2747 */
2749 /*opname*/ "solidify",
2750 /*slot_types_in*/
2751 {
2752 /* Input geometry. */
2754 /* Thickness of the solidified shell. */
2755 {"thickness", BMO_OP_SLOT_FLT},
2756 {{'\0'}},
2757 },
2758 /*slot_types_out*/
2759 {
2760 /* Output geometry (new shell faces, edges, and vertices). */
2761 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2762 {{'\0'}},
2763 },
2764 /*init*/ nullptr,
2767};
2768
2769/*
2770 * Face Inset (Individual).
2771 *
2772 * Insets individual faces.
2773 */
2775 /*opname*/ "inset_individual",
2776 /*slot_types_in*/
2777 {
2778 /* Input faces. */
2779 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2780 /* Inset distance from the boundary. */
2781 {"thickness", BMO_OP_SLOT_FLT},
2782 /* Distance to raise or lower the inset face along its normal. */
2783 {"depth", BMO_OP_SLOT_FLT},
2784 /* Scale the offset to give more even thickness. */
2785 {"use_even_offset", BMO_OP_SLOT_BOOL},
2786 /* Blend face data across the inset. */
2787 {"use_interpolate", BMO_OP_SLOT_BOOL},
2788 /* Scale the offset by surrounding geometry. */
2789 {"use_relative_offset", BMO_OP_SLOT_BOOL},
2790 {{'\0'}},
2791 },
2792 /*slot_types_out*/
2793 {
2794 /* Output faces. */
2795 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2796 {{'\0'}},
2797 },
2798 /*init*/ nullptr,
2800 /* Caller needs to handle BMO_OPTYPE_FLAG_SELECT_FLUSH. */
2801 /*type_flag*/ (BMO_OPTYPE_FLAG_NORMALS_CALC),
2802};
2803
2804/*
2805 * Face Inset (Regions).
2806 *
2807 * Inset or outset face regions.
2808 */
2810 /*opname*/ "inset_region",
2811 /*slot_types_in*/
2812 {
2813 /* Input faces. */
2814 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2815 /* Input faces to explicitly exclude from inset. */
2816 {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2817 /* Inset face boundaries. */
2818 {"use_boundary", BMO_OP_SLOT_BOOL},
2819 /* Scale the offset to give more even thickness. */
2820 {"use_even_offset", BMO_OP_SLOT_BOOL},
2821 /* Blend face data across the inset. */
2822 {"use_interpolate", BMO_OP_SLOT_BOOL},
2823 /* Scale the offset by surrounding geometry. */
2824 {"use_relative_offset", BMO_OP_SLOT_BOOL},
2825 /* Inset the region along existing edges. */
2826 {"use_edge_rail", BMO_OP_SLOT_BOOL},
2827 /* Inset distance from the boundary. */
2828 {"thickness", BMO_OP_SLOT_FLT},
2829 /* Distance to raise or lower the inset face along its normal. */
2830 {"depth", BMO_OP_SLOT_FLT},
2831 /* Outset rather than inset. */
2832 {"use_outset", BMO_OP_SLOT_BOOL},
2833 {{'\0'}},
2834 },
2835 /*slot_types_out*/
2836 {
2837 /* Output faces. */
2838 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2839 {{'\0'}},
2840 },
2841 /*init*/ nullptr,
2842 /*exec*/ bmo_inset_region_exec,
2844};
2845
2846/*
2847 * Edge-loop Offset.
2848 *
2849 * Creates edge loops based on simple edge-outset method.
2850 */
2852 /*opname*/ "offset_edgeloops",
2853 /*slot_types_in*/
2854 {
2855 /* Input edges. */
2856 {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2857 /* Extend loop around end-points. */
2858 {"use_cap_endpoint", BMO_OP_SLOT_BOOL},
2859 {{'\0'}},
2860 },
2861 /*slot_types_out*/
2862 {
2863 /* Output edges. */
2864 {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
2865 {{'\0'}},
2866 },
2867 /*init*/ nullptr,
2870};
2871
2872/*
2873 * Wire Frame.
2874 *
2875 * Makes a wire-frame copy of faces.
2876 */
2878 /*opname*/ "wireframe",
2879 /*slot_types_in*/
2880 {
2881 /* Input faces. */
2882 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2883 /* Wire thickness. */
2884 {"thickness", BMO_OP_SLOT_FLT},
2885 /* Offset the thickness from the center. */
2886 {"offset", BMO_OP_SLOT_FLT},
2887 /* Remove original geometry. */
2888 {"use_replace", BMO_OP_SLOT_BOOL},
2889 /* Inset face boundaries. */
2890 {"use_boundary", BMO_OP_SLOT_BOOL},
2891 /* Scale the offset to give more even thickness. */
2892 {"use_even_offset", BMO_OP_SLOT_BOOL},
2893 /* Crease hub edges for improved subdivision surface. */
2894 {"use_crease", BMO_OP_SLOT_BOOL},
2895 /* The mean crease weight for resulting edges. */
2896 {"crease_weight", BMO_OP_SLOT_FLT},
2897 /* Scale the offset by surrounding geometry. */
2898 {"use_relative_offset", BMO_OP_SLOT_BOOL},
2899 /* Offset material index of generated faces. */
2900 {"material_offset", BMO_OP_SLOT_INT},
2901 {{'\0'}},
2902 },
2903 /*slot_types_out*/
2904 {
2905 /* Output faces. */
2906 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2907 {{'\0'}},
2908 },
2909 /*init*/ nullptr,
2910 /*exec*/ bmo_wireframe_exec,
2911 /*type_flag*/
2914};
2915
2917 {BMOP_POKE_MEDIAN_WEIGHTED, "MEAN_WEIGHTED"},
2918 {BMOP_POKE_MEDIAN, "MEAN"},
2919 {BMOP_POKE_BOUNDS, "BOUNDS"},
2920 {0, nullptr},
2921};
2922
2923/*
2924 * Pokes a face.
2925 *
2926 * Splits a face into a triangle fan.
2927 */
2929 /*opname*/ "poke",
2930 /*slot_types_in*/
2931 {
2932 /* Input faces. */
2933 {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2934 /* Center vertex offset along normal. */
2935 {"offset", BMO_OP_SLOT_FLT},
2936 /* Calculation mode for center vertex. */
2937 {"center_mode",
2941 /* Apply offset. */
2942 {"use_relative_offset", BMO_OP_SLOT_BOOL},
2943 {{'\0'}},
2944 },
2945 /*slot_types_out*/
2946 {
2947 /* Output verts. */
2948 {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
2949 /* Output faces. */
2950 {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
2951 {{'\0'}},
2952 },
2953 /*init*/ nullptr,
2954 /*exec*/ bmo_poke_exec,
2955 /*type_flag*/
2958};
2959
2960#ifdef WITH_BULLET
2961/*
2962 * Convex Hull
2963 *
2964 * Builds a convex hull from the vertices in `input`.
2965 *
2966 * If `use_existing_faces` is true, the hull will not output triangles
2967 * that are covered by a pre-existing face.
2968 *
2969 * All hull vertices, faces, and edges are added to `geom.out`. Any
2970 * input elements that end up inside the hull (i.e. are not used by an
2971 * output face) are added to the `geom_interior.out` slot. The
2972 * `geom_unused.out` slot will contain all interior geometry that is
2973 * completely unused. Lastly, `geom_holes.out` contains edges and faces
2974 * that were in the input and are part of the hull.
2975 */
2976static BMOpDefine bmo_convex_hull_def = {
2977 /*opname*/ "convex_hull",
2978 /*slot_types_in*/
2979 {
2980 /* Input geometry. */
2982 /* Skip hull triangles that are covered by a pre-existing face. */
2983 {"use_existing_faces", BMO_OP_SLOT_BOOL},
2984 {{'\0'}},
2985 },
2986 /*slot_types_out*/
2987 {
2988 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2989 {"geom_interior.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2990 {"geom_unused.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2991 {"geom_holes.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
2992 {{'\0'}},
2993 },
2994 /*init*/ nullptr,
2995 /*exec*/ bmo_convex_hull_exec,
2996 /*type_flag*/
2999};
3000#endif
3001
3007
3008/*
3009 * Space Evenly.
3010 *
3011 * Space the vertices in a regular distribution on the loop.
3012 */
3014 /*opname*/ "space_edge_loops_evenly",
3015 /*slot_types_in*/
3016 {
3017 /* Input geometry. */
3018 {"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
3019 /* Method used for interpolation. */
3020 {"interpolation",
3024 /* Influence factor: spans from 0.0 to 1.0. */
3025 {"factor", BMO_OP_SLOT_FLT},
3026 /* Lock X-axis editing. */
3027 {"lock_x", BMO_OP_SLOT_BOOL},
3028 /* Lock Y-axis editing. */
3029 {"lock_y", BMO_OP_SLOT_BOOL},
3030 /* Lock Z-axis editing. */
3031 {"lock_z", BMO_OP_SLOT_BOOL},
3032 {{'\0'}},
3033 },
3034 /*slot_types_out*/
3035 {{{'\0'}}},
3036 /*init*/ nullptr,
3038 /*type_flag*/
3040};
3041
3042/*
3043 * Symmetrize.
3044 *
3045 * Makes the mesh elements in the `input` slot symmetrical. Unlike
3046 * normal mirroring, it only copies in one direction, as specified by
3047 * the `direction` slot. The edges and faces that cross the plane of
3048 * symmetry are split as needed to enforce symmetry.
3049 *
3050 * All new vertices, edges, and faces are added to the `geom.out` slot.
3051 */
3053 /*opname*/ "symmetrize",
3054 /*slot_types_in*/
3055 {
3056 /* Input geometry. */
3058 /* Axis to use. */
3059 {"direction",
3063 /* Minimum distance. */
3064 {"dist", BMO_OP_SLOT_FLT},
3065 /* Transform shape keys too. */
3066 {"use_shapekey", BMO_OP_SLOT_BOOL},
3067 {{'\0'}},
3068 },
3069 /*slot_types_out*/
3070 {
3071 {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},
3072 {{'\0'}},
3073 },
3074 /*init*/ nullptr,
3075 /*exec*/ bmo_symmetrize_exec,
3076 /*type_flag*/
3079};
3080
3081#undef BM_FACE
3082#undef BM_EDGE
3083#undef BM_VERT
3084
3101#ifdef WITH_BULLET
3102 &bmo_convex_hull_def,
3103#endif
3142 &bmo_poke_def,
3159 &bmo_spin_def,
3175};
3176
3178
3179} // namespace blender
#define BM_FACE
#define BM_EDGE
#define BM_VERT
BMesh Iterators.
static BMOpDefine bmo_scale_def
static BMO_FlagSet bmo_enum_space_edge_loops_evenly_interpolation_method[]
static BMO_FlagSet bmo_enum_subdivide_edgering_interp_mode[]
void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_bevel_affect_type[]
static BMOpDefine bmo_pointmerge_facedata_def
static BMOpDefine bmo_reverse_uvs_def
@ BEVEL_FACE_STRENGTH_ALL
@ BEVEL_FACE_STRENGTH_NEW
@ BEVEL_FACE_STRENGTH_NONE
@ BEVEL_FACE_STRENGTH_AFFECTED
static BMOpDefine bmo_extrude_vert_indiv_def
void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
Definition bmo_create.cc:24
static BMOpDefine bmo_planar_faces_def
static BMOpDefine bmo_dissolve_verts_def
static BMOpDefine bmo_connect_verts_def
@ BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL
@ BMO_OP_SLOT_SUBTYPE_MAP_EMPTY
void bmo_rotate_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:517
void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
Definition bmo_inset.cc:669
static BMO_FlagSet bmo_enum_dissolve_limit_flags[]
void bmo_bisect_edges_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_rotate_edges_def
static BMO_FlagSet bmo_enum_axis_xyz[]
void bmo_connect_verts_concave_exec(BMesh *bm, BMOperator *op)
void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
void bmo_rotate_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:129
static BMOpDefine bmo_triangle_fill_def
static BMOpDefine bmo_dissolve_degenerate_def
void bmo_bisect_plane_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_grid_fill_def
void bmo_transform_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:53
void bmo_planar_faces_exec(BMesh *bm, BMOperator *op)
void bmo_triangulate_exec(BMesh *bm, BMOperator *op)
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_extrude_face_region_def
static BMO_FlagSet bmo_enum_axis_neg_xyz_and_xyz[]
static BMOpDefine bmo_create_monkey_def
void bmo_join_triangles_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_create_vert_def
void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_dissolve_limit_def
void bmo_holes_fill_exec(BMesh *bm, BMOperator *op)
void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_solidify_def
static BMOpDefine bmo_split_edges_def
static BMO_FlagSet bmo_enum_triangulate_ngon_method[]
void bmo_face_attribute_fill_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_connect_vert_pair_def
void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
void bmo_wireframe_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_poke_def
static BMOpDefine bmo_unsubdivide_def
void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_rotate_def
void bmo_region_extend_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:413
static BMOpDefine bmo_mirror_def
@ SPACE_EDGE_LOOPS_EVENLY_INTERP_CUBIC
@ SPACE_EDGE_LOOPS_EVENLY_INTERP_LINEAR
void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_fit_edge_loops_to_annotation_def
void bmo_reverse_faces_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:156
static BMOpDefine bmo_create_grid_def
void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_curve_interpolation_method[]
@ RELAX_EDGE_LOOPS_INTERP_LINEAR
@ RELAX_EDGE_LOOPS_INTERP_CUBIC
void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_bevel_profile_type[]
static BMO_FlagSet bmo_enum_triangulate_quad_method[]
void bmo_collapse_uvs_exec(BMesh *bm, BMOperator *op)
void bmo_reverse_uvs_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:605
static BMOpDefine bmo_create_icosphere_def
void bmo_bevel_exec(BMesh *bm, BMOperator *op)
Definition bmo_bevel.cc:21
static BMOpDefine bmo_recalc_face_normals_def
void bmo_mirror_exec(BMesh *bm, BMOperator *op)
Definition bmo_mirror.cc:22
static BMO_FlagSet bmo_enum_bevel_face_strength_type[]
static BMOpDefine bmo_connect_verts_concave_def
void bmo_connect_verts_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_bisect_plane_def
static BMOpDefine bmo_dissolve_edges_def
void bmo_flip_quad_tessellation_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:174
static BMOpDefine bmo_translate_def
static BMOpDefine bmo_create_circle_def
static BMOpDefine bmo_weld_verts_def
void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_bevel_offset_type[]
void bmo_circularize_exec(BMesh *bm, BMOperator *op)
@ SUBD_CORNER_STRAIGHT_CUT
@ SUBD_CORNER_INNERVERT
static BMO_FlagSet bmo_enum_bevel_vmesh_method[]
static BMOpDefine bmo_contextual_create_def
static BMO_FlagSet bmo_enum_falloff_type[]
static BMOpDefine bmo_create_quadsphere_def
static BMOpDefine bmo_create_cube_def
static BMOpDefine bmo_collapse_def
@ BMO_OP_SLOT_SUBTYPE_PTR_STRUCT
@ BMO_OP_SLOT_SUBTYPE_PTR_SCENE
@ BMO_OP_SLOT_SUBTYPE_PTR_OBJECT
@ BMO_OP_SLOT_SUBTYPE_PTR_BMESH
const int bmo_opdefines_total
static BMOpDefine bmo_space_edge_loops_evenly_def
static BMOpDefine bmo_split_def
static BMOpDefine bmo_reverse_colors_def
void bmo_scale_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:106
static BMOpDefine bmo_bisect_edges_def
static BMOpDefine bmo_create_cone_def
static BMO_FlagSet bmo_enum_quadsphere_method[]
static BMO_FlagSet bmo_enum_relax_edge_loops_interpolation_method[]
void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_flip_quad_tessellation_def
static BMOpDefine bmo_duplicate_def
static BMOpDefine bmo_object_load_bmesh_def
static BMOpDefine bmo_join_triangles_def
@ SUBD_FALLOFF_INVSQUARE
void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_bridge_loops_def
void bmo_grid_fill_exec(BMesh *bm, BMOperator *op)
void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_inset_region_def
void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op)
@ CURVE_CLAMP_ELEVATION_RAISE
@ CURVE_CLAMP_ELEVATION_LOWER
@ CURVE_CLAMP_ELEVATION_NONE
void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_face_attribute_fill_def
void bmo_dissolve_edges_init(BMOperator *op)
void bmo_relax_edge_loops_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_bevel_def
void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_poke_center_mode[]
void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void bmo_rotate_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:643
void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_find_doubles_def
void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op)
void bmo_pointmerge_exec(BMesh *bm, BMOperator *op)
void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
static eBMOpSlotSubType_Union to_subtype_union(const eBMOpSlotSubType_Ptr ptr)
void bmo_flatten_exec(BMesh *bm, BMOperator *op)
@ BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE
void bmo_create_vert_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:37
void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_extrude_discrete_faces_def
static BMOpDefine bmo_circularize_def
void bmo_delete_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:527
void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_connect_verts_nonplanar_def
void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_subdivide_edgering_def
static BMOpDefine bmo_curve_edge_loops_between_selected_def
const BMOpDefine * bmo_opdefines[]
static BMOpDefine bmo_create_uvsphere_def
static BMO_FlagSet bmo_enum_bevel_miter_type[]
static BMOpDefine bmo_transform_def
static BMOpDefine bmo_bmesh_to_mesh_def
void bmo_inset_individual_exec(BMesh *bm, BMOperator *op)
Definition bmo_inset.cc:419
void bmo_create_quadsphere_exec(BMesh *bm, BMOperator *op)
void bmo_spin_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:547
static BMOpDefine bmo_spin_def
void bmo_poke_exec(BMesh *bm, BMOperator *op)
Definition bmo_poke.cc:32
static BMOpDefine bmo_subdivide_edges_def
static BMOpDefine bmo_average_vert_facedata_def
void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_relax_edge_loops_def
void bmo_pointmerge_facedata_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_extrude_edge_only_def
void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op)
void bmo_remove_doubles_exec(BMesh *bm, BMOperator *op)
@ TO_ANNOTATION_SPREAD_EVENLY
void bmo_duplicate_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:370
static BMOpDefine bmo_pointmerge_def
static BMO_FlagSet bmo_enum_fit_edge_loops_to_annotation_method[]
void bmo_space_edge_loops_evenly_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_flatten_def
void bmo_weld_verts_exec(BMesh *bm, BMOperator *op)
void bmo_offset_edgeloops_exec(BMesh *bm, BMOperator *op)
@ SUBD_RING_INTERP_SURF
@ SUBD_RING_INTERP_PATH
@ SUBD_RING_INTERP_LINEAR
static BMOpDefine bmo_inset_individual_def
static BMOpDefine bmo_dissolve_faces_def
void bmo_smooth_vert_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:437
static BMOpDefine bmo_triangulate_def
static BMOpDefine bmo_beautify_fill_def
@ BMO_OPTYPE_FLAG_SELECT_VALIDATE
@ BMO_OPTYPE_FLAG_UNTAN_MULTIRES
static BMOpDefine bmo_smooth_laplacian_vert_def
void bmo_connect_verts_nonplanar_exec(BMesh *bm, BMOperator *op)
void bmo_unsubdivide_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_region_extend_def
@ MOD_TRIANGULATE_QUAD_LONGEDGE
@ MOD_TRIANGULATE_QUAD_ALTERNATE
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
static BMOpDefine bmo_delete_def
static BMOpDefine bmo_smooth_vert_def
@ BEVEL_PROFILE_SUPERELLIPSE
static BMO_FlagSet bmo_enum_subdivide_edges_quad_corner_type[]
static BMOpDefine bmo_edgeloop_fill_def
void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
void bmo_split_exec(BMesh *bm, BMOperator *op)
Definition bmo_dupe.cc:433
static BMOpDefine bmo_collapse_uvs_def
static BMOpDefine bmo_rotate_colors_def
void bmo_average_vert_facedata_exec(BMesh *bm, BMOperator *op)
void bmo_fit_edge_loops_to_annotation_exec(BMesh *bm, BMOperator *op)
void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_curve_restriction[]
@ QUADSPHERE_METHOD_EQUI_ANGULAR
@ QUADSPHERE_METHOD_EQUI_ANGULAR_EVEN_AREA
static BMOpDefine bmo_mesh_to_bmesh_def
void bmo_create_monkey_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_edgenet_fill_def
static BMO_FlagSet bmo_enum_delete_context[]
static BMOpDefine bmo_symmetrize_def
void bmo_find_doubles_exec(BMesh *bm, BMOperator *op)
void bmo_curve_edge_loops_between_selected_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_rotate_uvs_def
static BMOpDefine bmo_wireframe_def
static BMOpDefine bmo_reverse_faces_def
void bmo_translate_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:85
static BMOpDefine bmo_holes_fill_def
void bmo_symmetrize_exec(BMesh *bm, BMOperator *op)
static BMOpDefine bmo_offset_edgeloops_def
void bmo_edgeloop_fill_exec(BMesh *bm, BMOperator *op)
void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
void bmo_reverse_colors_exec(BMesh *bm, BMOperator *op)
Definition bmo_utils.cc:749
void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
static BMO_FlagSet bmo_enum_beautify_fill_method[]
void bmo_collapse_exec(BMesh *bm, BMOperator *op)
@ BMOP_POKE_MEDIAN_WEIGHTED
static BMOpDefine bmo_edgenet_prepare_def
static BMOpDefine bmo_remove_doubles_def