#include "bmesh.h"
#include "intern/bmesh_private.h"
-/* ok, I'm going to write a little docgen script. so all
- * bmop comments must conform to the following template/rules:
+/* The formatting of these bmesh operators is parsed by
+ * 'doc/python_api/rst_from_bmesh_opdefines.py'
+ * for use in python docs, so reStructuredText may be used
+ * rather then doxygen syntax.
*
* template (py quotes used because nested comments don't work
* on all C compilers):
* so the first line is the "title" of the bmop.
* subsequent line blocks separated by blank lines
* are paragraphs. individual descriptions of slots
- * would be extracted from comments
- * next to them, e.g.
+ * are extracted from comments next to them.
*
- * {BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, //output slot, boundary region
+ * eg:
+ * {BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, """ output slot, boundary region """
*
- * the doc generator would automatically detect the presence of "output slot"
- * and flag the slot as an output. the same happens for "input slot". also
- * note that "edges", "faces", "verts", "loops", and "geometry" are valid
- * substitutions for "slot".
+ * ... or:
*
- * note that slots default to being input slots.
+ * """ output slot, boundary region """
+ * {BMO_OP_SLOT_ELEMENT_BUF, "geom.out"},
+ *
+ * Both are acceptable.
+ * note that '//' comments are ignored.
*/
/*
- * Vertex Smooth
+ * Vertex Smooth.
*
* Smooths vertices by using a basic vertex averaging scheme.
*/
{"mirror_clip_x", BMO_OP_SLOT_BOOL}, /* set vertices close to the x axis before the operation to 0 */
{"mirror_clip_y", BMO_OP_SLOT_BOOL}, /* set vertices close to the y axis before the operation to 0 */
{"mirror_clip_z", BMO_OP_SLOT_BOOL}, /* set vertices close to the z axis before the operation to 0 */
- {"clip_dist", BMO_OP_SLOT_FLT}, /* clipping threshod for the above three slots */
+ {"clip_dist", BMO_OP_SLOT_FLT}, /* clipping threshold for the above three slots */
{"use_axis_x", BMO_OP_SLOT_BOOL}, /* smooth vertices along X axis */
{"use_axis_y", BMO_OP_SLOT_BOOL}, /* smooth vertices along Y axis */
{"use_axis_z", BMO_OP_SLOT_BOOL}, /* smooth vertices along Z axis */
};
/*
- * Vertext Smooth Laplacian
+ * Vertext Smooth Laplacian.
+ *
* Smooths vertices by using Laplacian smoothing propose by.
- * Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow
+ * Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow.
*/
static BMOpDefine bmo_smooth_laplacian_vert_def = {
"smooth_laplacian_vert",
};
/*
- * Right-Hand Faces
+ * Right-Hand Faces.
*
* Computes an "outside" normal for the specified input faces.
*/
-
static BMOpDefine bmo_recalc_face_normals_def = {
"recalc_face_normals",
/* slots_in */
{{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
- {"use_flip", BMO_OP_SLOT_BOOL}, /* internal flag, used by bmesh_rationalize_normals */
+ {"use_flip", BMO_OP_SLOT_BOOL}, /* Reverse the result */
{{'\0'}},
},
{{{'\0'}}}, /* no output */
};
/*
- * Region Extend
+ * Region Extend.
*
* used to implement the select more/less tools.
* this puts some geometry surrounding regions of
* geometry in geom into geom.out.
*
- * if usefaces is 0 then geom.out spits out verts and edges,
+ * if use_faces is 0 then geom.out spits out verts and edges,
* otherwise it spits out faces.
*/
static BMOpDefine bmo_region_extend_def = {
};
/*
- * Edge Rotate
+ * Edge Rotate.
*
* Rotates edges topologically. Also known as "spin edge" to some people.
- * Simple example: [/] becomes [|] then [\].
+ * Simple example: ``[/] becomes [|] then [\]``.
*/
static BMOpDefine bmo_rotate_edges_def = {
"rotate_edges",
/* slots_in */
{{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
- {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate edge counter-clockwise if true, othewise clockwise */
+ {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate edge counter-clockwise if true, otherwise clockwise */
{{'\0'}},
},
/* slots_out */
};
/*
- * Reverse Faces
+ * Reverse Faces.
*
- * Reverses the winding (vertex order) of faces. This has the effect of
- * flipping the normal.
+ * Reverses the winding (vertex order) of faces.
+ * This has the effect of flipping the normal.
*/
static BMOpDefine bmo_reverse_faces_def = {
"reverse_faces",
};
/*
- * Edge Bisect
+ * Edge Bisect.
*
* Splits input edges (but doesn't do anything else).
* This creates a 2-valence vert.
};
/*
- * Mirror
+ * Mirror.
*
* Mirrors geometry along an axis. The resulting geometry is welded on using
* merge_dist. Pairs of original/mirrored vertices are welded using the merge_dist
* parameter (which defines the minimum distance for welding to happen).
*/
-
static BMOpDefine bmo_mirror_def = {
"mirror",
/* slots_in */
};
/*
- * Find Doubles
+ * Find Doubles.
*
- * Takes input verts and find vertices they should weld to. Outputs a
- * mapping slot suitable for use with the weld verts bmop.
+ * Takes input verts and find vertices they should weld to.
+ * Outputs a mapping slot suitable for use with the weld verts bmop.
*
* If keep_verts is used, vertices outside that set can only be merged
* with vertices in that set.
};
/*
- * Remove Doubles
+ * Remove Doubles.
*
* Finds groups of vertices closer then dist and merges them together,
* using the weld verts bmop.
};
/*
- * Auto Merge
+ * Auto Merge.
*
- * Finds groups of vertices closer then dist and merges them together,
+ * Finds groups of vertices closer then **dist** and merges them together,
* using the weld verts bmop. The merges must go from a vert not in
- * verts to one in verts.
+ * **verts** to one in **verts**.
*/
static BMOpDefine bmo_automerge_def = {
"automerge",
};
/*
- * Collapse Connected
+ * Collapse Connected.
*
* Collapses connected vertices
*/
BMO_OP_FLAG_UNTAN_MULTIRES,
};
-
/*
- * Facedata point Merge
+ * Face-Data Point Merge.
*
* Merge uv/vcols at a specific vertex.
*/
};
/*
- * Average Vertices Facevert Data
+ * Average Vertices Facevert Data.
*
* Merge uv/vcols associated with the input vertices at
* the bounding box center. (I know, it's not averaging but
};
/*
- * Point Merge
+ * Point Merge.
*
* Merge verts together at a point.
*/
};
/*
- * Collapse Connected UVs
+ * Collapse Connected UV's.
*
* Collapses connected UV vertices.
*/
};
/*
- * Weld Verts
+ * Weld Verts.
*
- * Welds verts together (kindof like remove doubles, merge, etc, all of which
+ * Welds verts together (kind-of like remove doubles, merge, etc, all of which
* use or will use this bmop). You pass in mappings from vertices to the vertices
* they weld with.
*/
};
/*
- * Make Vertex
+ * Make Vertex.
*
* Creates a single vertex; this bmop was necessary
* for click-create-vertex.
};
/*
- * Join Triangles
+ * Join Triangles.
*
* Tries to intelligently join triangles according
* to various settings and stuff.
};
/*
- * Contextual Create
+ * Contextual Create.
*
- * This is basically fkey, it creates
+ * This is basically F-key, it creates
* new faces from vertices, makes stuff from edge nets,
- * makes wire edges, etc. It also dissolves
- * faces.
+ * makes wire edges, etc. It also dissolves faces.
*
* Three verts become a triangle, four become a quad. Two
* become a wire edge.
};
/*
- * Bridge edge loops with faces
+ * Bridge edge loops with faces.
*/
static BMOpDefine bmo_bridge_loops_def = {
"bridge_loops",
0,
};
+/*
+ * Edge Net Fill.
+ *
+ * Create faces defined by enclosed edges.
+ */
static BMOpDefine bmo_edgenet_fill_def = {
"edgenet_fill",
/* slots_in */
};
/*
- * Edgenet Prepare
+ * Edgenet Prepare.
*
* Identifies several useful edge loop cases and modifies them so
* they'll become a face when edgenet_fill is called. The cases covered are:
};
/*
- * Rotate
+ * Rotate.
*
* Rotate vertices around a center, using a 3x3 rotation
* matrix. Equivalent of the old rotateflag function.
};
/*
- * Translate
+ * Translate.
*
* Translate vertices by an offset. Equivalent of the
* old translateflag function.
};
/*
- * Scale
+ * Scale.
*
* Scales vertices by an offset.
*/
/*
- * Transform
+ * Transform.
*
* Transforms a set of vertices by a matrix. Multiplies
* the vertex coordinates with the matrix.
};
/*
- * Object Load BMesh
+ * Object Load BMesh.
*
* Loads a bmesh into an object/mesh. This is a "private"
* bmop.
/*
- * BMesh to Mesh
+ * BMesh to Mesh.
*
* Converts a bmesh to a Mesh. This is reserved for exiting editmode.
*/
};
/*
- * Mesh to BMesh
+ * Mesh to BMesh.
*
* Load the contents of a mesh into the bmesh. this bmop is private, it's
* reserved exclusively for entering editmode.
};
/*
- * Individual Face Extrude
+ * Individual Face Extrude.
*
* Extrudes faces individually.
*/
};
/*
- * Extrude Only Edges
+ * Extrude Only Edges.
*
* Extrudes Edges into faces, note that this is very simple, there's no fancy
* winged extrusion.
};
/*
- * Individual Vertex Extrude
+ * Individual Vertex Extrude.
*
* Extrudes wire edges from vertices.
*/
0
};
+/*
+ * Connect Verts.
+ *
+ * Split faces by adding edges that connect **verts**.
+ */
static BMOpDefine bmo_connect_verts_def = {
"connect_verts",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Extrude Faces.
+ *
+ * Extrude operator (does not transform)
+ */
static BMOpDefine bmo_extrude_face_region_def = {
"extrude_face_region",
/* slots_in */
0
};
+/*
+ * Dissolve Verts.
+ */
static BMOpDefine bmo_dissolve_verts_def = {
"dissolve_verts",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Dissolve Edges.
+ */
static BMOpDefine bmo_dissolve_edges_def = {
"dissolve_edges",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Dissolve Edge Loop.
+ */
static BMOpDefine bmo_dissolve_edge_loop_def = {
"dissolve_edge_loop",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Dissolve Faces.
+ */
static BMOpDefine bmo_dissolve_faces_def = {
"dissolve_faces",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Limited Dissolve.
+ *
+ * Dissolve planar faces and co-linear edges.
+ */
static BMOpDefine bmo_dissolve_limit_def = {
"dissolve_limit",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Triangulate.
+ */
static BMOpDefine bmo_triangulate_def = {
"triangulate",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Un-Subdivide.
+ *
+ * Reduce detail in geometry containing grids.
+ */
static BMOpDefine bmo_unsubdivide_def = {
"unsubdivide",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Subdivide Edges.
+ *
+ * Advanced operator for subdividing edges
+ * with options for face patterns, smoothing and randomization.
+ */
static BMOpDefine bmo_subdivide_edges_def = {
"subdivide_edges",
/* slots_in */
BMO_OP_FLAG_UNTAN_MULTIRES
};
+/*
+ * Delete Geometry.
+ *
+ * Utility operator to delete geometry.
+ */
static BMOpDefine bmo_delete_def = {
"delete",
/* slots_in */
0
};
+/*
+ * Duplicate Geometry.
+ *
+ * Utility operator to duplicate geometry,
+ * optionally into a destination mesh.
+ */
static BMOpDefine bmo_duplicate_def = {
"duplicate",
/* slots_in */
0
};
+/*
+ * Split Off Geometry.
+ *
+ * Disconnect geometry from adjacent edges and faces,
+ * optionally into a destination mesh.
+ */
static BMOpDefine bmo_split_def = {
"split",
/* slots_in */
};
/*
- * Spin
+ * Spin.
*
* Extrude or duplicate geometry a number of times,
* rotating and possibly translating after each step
/*
- * Similar faces search
+ * Similar Faces Search.
*
* Find similar faces (area/material/perimeter, ...).
*/
};
/*
- * Similar edges search
+ * Similar Edges Search.
*
* Find similar edges (length, direction, edge, seam, ...).
*/
};
/*
- * Similar vertices search
+ * Similar Verts Search.
*
* Find similar vertices (normal, face, vertex group, ...).
*/
};
/*
- * uv rotation
- * cycle the uvs
+ * UV Rotation.
+ *
+ * Cycle the loop UV's
*/
static BMOpDefine bmo_rotate_uvs_def = {
"rotate_uvs",
/* slots_in */
{{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
- {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, othewise clockwise */
+ {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, otherwise clockwise */
{{'\0'}},
},
/* slots_out */
};
/*
- * uv reverse
- * reverse the uvs
+ * UV Reverse.
+ *
+ * Reverse the UV's
*/
static BMOpDefine bmo_reverse_uvs_def = {
"reverse_uvs",
};
/*
- * color rotation
- * cycle the colors
+ * Color Rotation.
+ *
+ * Cycle the loop colors
*/
static BMOpDefine bmo_rotate_colors_def = {
"rotate_colors",
/* slots_in */
{{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
- {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, othewise clockwise */
+ {"use_ccw", BMO_OP_SLOT_BOOL}, /* rotate counter-clockwise if true, otherwise clockwise */
{{'\0'}},
},
{{{'\0'}}}, /* no output */
};
/*
- * color reverse
- * reverse the colors
+ * Color Reverse
+ *
+ * Reverse the loop colors.
*/
static BMOpDefine bmo_reverse_colors_def = {
"reverse_colors",
};
/*
- * Similar vertices search
+ * Shortest Path.
*
- * Find similar vertices (normal, face, vertex group, ...).
+ * Select the shortest path between 2 verts.
*/
static BMOpDefine bmo_shortest_path_def = {
"shortest_path",
};
/*
- * Edge Split
+ * Edge Split.
*
* Disconnects faces along input edges.
*/
};
/*
- * Create Grid
+ * Create Grid.
*
* Creates a grid with a variable number of subdivisions
*/
};
/*
- * Create UV Sphere
+ * Create UV Sphere.
*
* Creates a grid with a variable number of subdivisions
*/
};
/*
- * Create Ico Sphere
+ * Create Ico-Sphere.
*
* Creates a grid with a variable number of subdivisions
*/
};
/*
- * Create Suzanne
+ * Create Suzanne.
*
- * Creates a monkey. Be wary.
+ * Creates a monkey (standard blender primitive).
*/
static BMOpDefine bmo_create_monkey_def = {
"create_monkey",
};
/*
- * Create Cone
+ * Create Cone.
*
* Creates a cone with variable depth at both ends
*/
static BMOpDefine bmo_create_cone_def = {
"create_cone",
/* slots_in */
- {{"cap_ends", BMO_OP_SLOT_BOOL}, /* wheter or not to fill in the ends with faces */
+ {{"cap_ends", BMO_OP_SLOT_BOOL}, /* whether or not to fill in the ends with faces */
{"cap_tris", BMO_OP_SLOT_BOOL}, /* fill ends with triangles instead of ngons */
{"segments", BMO_OP_SLOT_INT},
{"diameter1", BMO_OP_SLOT_FLT}, /* diameter of one end */
};
/*
- * Creates a circle
+ * Creates a Circle.
*/
static BMOpDefine bmo_create_circle_def = {
"create_circle",
/* slots_in */
- {{"cap_ends", BMO_OP_SLOT_BOOL}, /* wheter or not to fill in the ends with faces */
+ {{"cap_ends", BMO_OP_SLOT_BOOL}, /* whether or not to fill in the ends with faces */
{"cap_tris", BMO_OP_SLOT_BOOL}, /* fill ends with triangles instead of ngons */
{"segments", BMO_OP_SLOT_INT},
{"diameter", BMO_OP_SLOT_FLT}, /* diameter of one end */
};
/*
- * Create Cone
+ * Create Cube
*
- * Creates a cone with variable depth at both ends
+ * Creates a cube.
*/
static BMOpDefine bmo_create_cube_def = {
"create_cube",
};
/*
- * Bevel
+ * Bevel.
*
* Bevels edges and vertices
*/
{{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */
{{'\0'}},
},
-#if 0 /* old bevel*/
- {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */
- {"face_spans", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new geometry */
- {"face_holes", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new geometry */
- {"use_lengths", BMO_OP_SLOT_BOOL}, /* grab edge lengths from a PROP_FLT customdata layer */
- {"use_even", BMO_OP_SLOT_BOOL}, /* corner vert placement: use shell/angle calculations */
- {"use_dist", BMO_OP_SLOT_BOOL}, /* corner vert placement: evaluate percent as a distance,
- * modifier uses this. We could do this as another float setting */
- {"lengthlayer", BMO_OP_SLOT_INT}, /* which PROP_FLT layer to us */
- {"percent", BMO_OP_SLOT_FLT}, /* percentage to expand beveled edge */
- {{'\0'}},
- },
-#endif
+/* old bevel*/
+// {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */
+// {"face_spans", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new geometry */
+// {"face_holes", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* new geometry */
+// {"use_lengths", BMO_OP_SLOT_BOOL}, /* grab edge lengths from a PROP_FLT customdata layer */
+// {"use_even", BMO_OP_SLOT_BOOL}, /* corner vert placement: use shell/angle calculations */
+// {"use_dist", BMO_OP_SLOT_BOOL}, /* corner vert placement: evaluate percent as a distance,
+// * modifier uses this. We could do this as another float setting */
+// {"lengthlayer", BMO_OP_SLOT_INT}, /* which PROP_FLT layer to us */
+// {"percent", BMO_OP_SLOT_FLT}, /* percentage to expand beveled edge */
+// {{'\0'}},
+// },
+
bmo_bevel_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
/*
- * Beautify Fill
+ * Beautify Fill.
*
- * Makes triangle a bit nicer
+ * Rotate edges to create more evenly spaced triangles.
*/
static BMOpDefine bmo_beautify_fill_def = {
"beautify_fill",
};
/*
- * Triangle Fill
+ * Triangle Fill.
*
* Fill edges with triangles
*/
};
/*
- * Solidify
+ * Solidify.
*
* Turns a mesh into a shell with thickness
*/
};
/*
- * Face Inset
+ * Face Inset.
*
- * Extrudes faces individually.
+ * Inset or outset faces.
*/
static BMOpDefine bmo_inset_def = {
"inset",
};
/*
- * Wire Frame
+ * Wire Frame.
*
- * Makes a wire copy of faces.
+ * Makes a wire-frame copy of faces.
*/
static BMOpDefine bmo_wireframe_def = {
"wireframe",
};
/*
- * Vertex Slide
+ * Vertex Slide.
*
- * Translates vertes along an edge
+ * Translates verts along an edge
*/
static BMOpDefine bmo_slide_vert_def = {
"slide_vert",
#endif
/*
- * Symmetrize
+ * Symmetrize.
*
- * Mekes the mesh elements in the "input" slot symmetrical. Unlike
+ * Makes the mesh elements in the "input" slot symmetrical. Unlike
* normal mirroring, it only copies in one direction, as specified by
* the "direction" slot. The edges and faces that cross the plane of
* symmetry are split as needed to enforce symmetry.