Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/intern/bmesh_opdefines.c
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| * | * | ||||
| */ | */ | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "bmesh.h" | #include "bmesh.h" | ||||
| #include "intern/bmesh_operators_private.h" | #include "intern/bmesh_operators_private.h" | ||||
| #include "DNA_modifier_types.h" | |||||
| /* The formatting of these bmesh operators is parsed by | /* The formatting of these bmesh operators is parsed by | ||||
| * 'doc/python_api/rst_from_bmesh_opdefines.py' | * 'doc/python_api/rst_from_bmesh_opdefines.py' | ||||
| * for use in python docs, so reStructuredText may be used | * for use in python docs, so reStructuredText may be used | ||||
| * rather then doxygen syntax. | * rather then doxygen syntax. | ||||
| * | * | ||||
| * template (py quotes used because nested comments don't work | * template (py quotes used because nested comments don't work | ||||
| * on all C compilers): | * on all C compilers): | ||||
| * | * | ||||
| Show All 20 Lines | |||||
| * | * | ||||
| * """ output slot, boundary region """ | * """ output slot, boundary region """ | ||||
| * {BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, | * {BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, | ||||
| * | * | ||||
| * Both are acceptable. | * Both are acceptable. | ||||
| * note that '//' comments are ignored. | * note that '//' comments are ignored. | ||||
| */ | */ | ||||
| /* enums shared between multiple operators */ | |||||
| static BMO_FlagSet bmo_enum_axis_xyz[] = { | |||||
| {0, "X"}, | |||||
| {1, "Y"}, | |||||
| {2, "Z"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| static BMO_FlagSet bmo_enum_falloff_type[] = { | |||||
| {SUBD_FALLOFF_SMOOTH, "SMOOTH"}, | |||||
| {SUBD_FALLOFF_SPHERE, "SPHERE"}, | |||||
| {SUBD_FALLOFF_ROOT, "ROOT"}, | |||||
| {SUBD_FALLOFF_SHARP, "SHARP"}, | |||||
| {SUBD_FALLOFF_LIN, "LINEAR"}, | |||||
| {SUBD_FALLOFF_INVSQUARE, "INVERSE_SQUARE"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| static BMO_FlagSet bmo_enum_compare_types[] = { | |||||
| {SIM_CMP_EQ, "EQUAL"}, | |||||
| {SIM_CMP_GT, "GREATER_THAN"}, | |||||
| {SIM_CMP_LT, "LESS_THAN"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Vertex Smooth. | * Vertex Smooth. | ||||
| * | * | ||||
| * Smooths vertices by using a basic vertex averaging scheme. | * Smooths vertices by using a basic vertex averaging scheme. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_smooth_vert_def = { | static BMOpDefine bmo_smooth_vert_def = { | ||||
| "smooth_vert", | "smooth_vert", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| ▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | static BMOpDefine bmo_bisect_edges_def = { | ||||
| }, | }, | ||||
| bmo_bisect_edges_exec, | bmo_bisect_edges_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| /* | /* | ||||
campbellbarton: would make this general axis enum to be reused. | |||||
| * Mirror. | * Mirror. | ||||
| * | * | ||||
| * Mirrors geometry along an axis. The resulting geometry is welded on using | * 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 | * merge_dist. Pairs of original/mirrored vertices are welded using the merge_dist | ||||
| * parameter (which defines the minimum distance for welding to happen). | * parameter (which defines the minimum distance for welding to happen). | ||||
| */ | */ | ||||
| static BMOpDefine bmo_mirror_def = { | static BMOpDefine bmo_mirror_def = { | ||||
| "mirror", | "mirror", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */ | {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input geometry */ | ||||
| {"matrix", BMO_OP_SLOT_MAT}, /* matrix defining the mirror transformation */ | {"matrix", BMO_OP_SLOT_MAT}, /* matrix defining the mirror transformation */ | ||||
| {"merge_dist", BMO_OP_SLOT_FLT}, /* maximum distance for merging. does no merging if 0. */ | {"merge_dist", BMO_OP_SLOT_FLT}, /* maximum distance for merging. does no merging if 0. */ | ||||
| {"axis", BMO_OP_SLOT_INT}, /* the axis to use, 0, 1, or 2 for x, y, z */ | {"axis", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_axis_xyz}, /* the axis to use. */ | ||||
| {"mirror_u", BMO_OP_SLOT_BOOL}, /* mirror UVs across the u axis */ | {"mirror_u", BMO_OP_SLOT_BOOL}, /* mirror UVs across the u axis */ | ||||
| {"mirror_v", BMO_OP_SLOT_BOOL}, /* mirror UVs across the v axis */ | {"mirror_v", BMO_OP_SLOT_BOOL}, /* mirror UVs across the v axis */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output geometry, mirrored */ | {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* output geometry, mirrored */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 803 Lines • ▼ Show 20 Lines | static BMOpDefine bmo_dissolve_faces_def = { | ||||
| }, | }, | ||||
| bmo_dissolve_faces_exec, | bmo_dissolve_faces_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_dissolve_limit_flags[] = { | |||||
| {BMO_DELIM_NORMAL, "NORMAL"}, | |||||
| {BMO_DELIM_MATERIAL, "MATERIAL"}, | |||||
| {BMO_DELIM_SEAM, "SEAM"}, | |||||
| {BMO_DELIM_SHARP, "SHARP"}, | |||||
| {BMO_DELIM_UV, "UV"}, | |||||
| {0, NULL} | |||||
| }; | |||||
| /* | /* | ||||
| * Limited Dissolve. | * Limited Dissolve. | ||||
| * | * | ||||
| * Dissolve planar faces and co-linear edges. | * Dissolve planar faces and co-linear edges. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_dissolve_limit_def = { | static BMOpDefine bmo_dissolve_limit_def = { | ||||
| "dissolve_limit", | "dissolve_limit", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */ | {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */ | ||||
| {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL}, | {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL}, | ||||
| {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, | {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, | ||||
| {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | ||||
| {"delimit", BMO_OP_SLOT_INT}, | {"delimit", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_FLAG}, bmo_enum_dissolve_limit_flags}, | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | {{"region.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | ||||
| {{'\0'}}}, | {{'\0'}}}, | ||||
| bmo_dissolve_limit_exec, | bmo_dissolve_limit_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| Show All 17 Lines | static BMOpDefine bmo_dissolve_degenerate_def = { | ||||
| {{{'\0'}}}, | {{{'\0'}}}, | ||||
| bmo_dissolve_degenerate_exec, | bmo_dissolve_degenerate_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_triangulate_quad_method[] = { | |||||
| {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY"}, | |||||
| {MOD_TRIANGULATE_QUAD_FIXED, "FIXED"}, | |||||
| {MOD_TRIANGULATE_QUAD_ALTERNATE, "ALTERNATE"}, | |||||
| {MOD_TRIANGULATE_QUAD_SHORTEDGE, "SHORT_EDGE"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| static BMO_FlagSet bmo_enum_triangulate_ngon_method[] = { | |||||
| {MOD_TRIANGULATE_NGON_BEAUTY, "BEAUTY"}, | |||||
| {MOD_TRIANGULATE_NGON_EARCLIP, "EAR_CLIP"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Triangulate. | * Triangulate. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_triangulate_def = { | static BMOpDefine bmo_triangulate_def = { | ||||
| "triangulate", | "triangulate", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | ||||
| {"quad_method", BMO_OP_SLOT_INT}, | {"quad_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_triangulate_quad_method}, | ||||
| {"ngon_method", BMO_OP_SLOT_INT}, | {"ngon_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_triangulate_ngon_method}, | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | ||||
| {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, | ||||
| {"face_map.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, | {"face_map.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, | ||||
| {"face_map_double.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* duplicate faces */ | {"face_map_double.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* duplicate faces */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| Show All 19 Lines | static BMOpDefine bmo_unsubdivide_def = { | ||||
| {{{'\0'}}}, /* no output */ | {{{'\0'}}}, /* no output */ | ||||
| bmo_unsubdivide_exec, | bmo_unsubdivide_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_subdivide_edges_quad_corner_type[] = { | |||||
Done Inline Actions*picky* would put these on own line (single tab indent) avoids right shift or misalignment on batch renaming. campbellbarton: *picky* would put these on own line (single tab indent) avoids right shift or misalignment on… | |||||
| {SUBD_CORNER_STRAIGHT_CUT, "STRAIGHT_CUT"}, | |||||
| {SUBD_CORNER_INNERVERT, "INNER_VERT"}, | |||||
| {SUBD_CORNER_PATH, "PATH"}, | |||||
Done Inline ActionsCant this use enum values? campbellbarton: Cant this use enum values? | |||||
| {SUBD_CORNER_FAN, "FAN"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Subdivide Edges. | * Subdivide Edges. | ||||
| * | * | ||||
| * Advanced operator for subdividing edges | * Advanced operator for subdividing edges | ||||
| * with options for face patterns, smoothing and randomization. | * with options for face patterns, smoothing and randomization. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_subdivide_edges_def = { | static BMOpDefine bmo_subdivide_edges_def = { | ||||
| "subdivide_edges", | "subdivide_edges", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, | ||||
| {"smooth", BMO_OP_SLOT_FLT}, | {"smooth", BMO_OP_SLOT_FLT}, | ||||
| {"smooth_falloff", BMO_OP_SLOT_INT}, /* SUBD_FALLOFF_ROOT and friends */ | {"smooth_falloff", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_falloff_type}, /* smooth falloff type */ | ||||
| {"fractal", BMO_OP_SLOT_FLT}, | {"fractal", BMO_OP_SLOT_FLT}, | ||||
| {"along_normal", BMO_OP_SLOT_FLT}, | {"along_normal", BMO_OP_SLOT_FLT}, | ||||
| {"cuts", BMO_OP_SLOT_INT}, | {"cuts", BMO_OP_SLOT_INT}, | ||||
| {"seed", BMO_OP_SLOT_INT}, | {"seed", BMO_OP_SLOT_INT}, | ||||
| {"custom_patterns", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL}}, /* uses custom pointers */ | {"custom_patterns", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL}}, /* uses custom pointers */ | ||||
| {"edge_percents", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_FLT}}, | {"edge_percents", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_FLT}}, | ||||
| {"quad_corner_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_subdivide_edges_quad_corner_type}, /* quad corner type */ | |||||
| {"quad_corner_type", BMO_OP_SLOT_INT}, /* quad corner type, see bmesh_operators.h */ | |||||
| {"use_grid_fill", BMO_OP_SLOT_BOOL}, /* fill in fully-selected faces with a grid */ | {"use_grid_fill", BMO_OP_SLOT_BOOL}, /* fill in fully-selected faces with a grid */ | ||||
| {"use_single_edge", BMO_OP_SLOT_BOOL}, /* tessellate the case of one edge selected in a quad or triangle */ | {"use_single_edge", BMO_OP_SLOT_BOOL}, /* tessellate the case of one edge selected in a quad or triangle */ | ||||
| {"use_only_quads", BMO_OP_SLOT_BOOL}, /* only subdivide quads (for loopcut) */ | {"use_only_quads", BMO_OP_SLOT_BOOL}, /* only subdivide quads (for loopcut) */ | ||||
| {"use_sphere", BMO_OP_SLOT_BOOL}, /* for making new primitives only */ | {"use_sphere", BMO_OP_SLOT_BOOL}, /* for making new primitives only */ | ||||
| {"use_smooth_even", BMO_OP_SLOT_BOOL}, /* maintain even offset when smoothing */ | {"use_smooth_even", BMO_OP_SLOT_BOOL}, /* maintain even offset when smoothing */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {/* these next three can have multiple types of elements in them */ | {/* these next three can have multiple types of elements in them */ | ||||
| {"geom_inner.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | {"geom_inner.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | ||||
| {"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | {"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | ||||
| {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* contains all output geometry */ | {"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* contains all output geometry */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_subdivide_edges_exec, | bmo_subdivide_edges_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_subdivide_edgering_interp_mode[] = { | |||||
| {SUBD_RING_INTERP_LINEAR, "LINEAR"}, | |||||
| {SUBD_RING_INTERP_PATH, "PATH"}, | |||||
| {SUBD_RING_INTERP_SURF, "SURFACE"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Subdivide Edge-Ring. | * Subdivide Edge-Ring. | ||||
| * | * | ||||
| * Take an edge-ring, and subdivide with interpolation options. | * Take an edge-ring, and subdivide with interpolation options. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_subdivide_edgering_def = { | static BMOpDefine bmo_subdivide_edgering_def = { | ||||
| "subdivide_edgering", | "subdivide_edgering", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input vertices */ | {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input vertices */ | ||||
| {"interp_mode", BMO_OP_SLOT_INT}, | {"interp_mode", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_subdivide_edgering_interp_mode}, /* interpolation method */ | ||||
| {"smooth", BMO_OP_SLOT_FLT}, | {"smooth", BMO_OP_SLOT_FLT}, | ||||
| {"cuts", BMO_OP_SLOT_INT}, | {"cuts", BMO_OP_SLOT_INT}, | ||||
| {"profile_shape", BMO_OP_SLOT_INT}, | {"profile_shape", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_falloff_type}, /* profile shape type */ | ||||
| {"profile_shape_factor", BMO_OP_SLOT_FLT}, | {"profile_shape_factor", BMO_OP_SLOT_FLT}, | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | ||||
| {{'\0'}}}, | {{'\0'}}}, | ||||
| bmo_subdivide_edgering_exec, | bmo_subdivide_edgering_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| Show All 23 Lines | static BMOpDefine bmo_bisect_plane_def = { | ||||
| {{'\0'}}}, | {{'\0'}}}, | ||||
| bmo_bisect_plane_exec, | bmo_bisect_plane_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_delete_context[] = { | |||||
| {DEL_VERTS, "VERTS"}, | |||||
| {DEL_EDGES, "EDGES"}, | |||||
| {DEL_ONLYFACES, "FACES_ONLY"}, | |||||
| {DEL_EDGESFACES, "EDGES_FACES"}, | |||||
| {DEL_FACES, "FACES"}, | |||||
| {DEL_FACES_KEEP_BOUNDARY, "FACES_KEEP_BOUNDARY"}, | |||||
| {DEL_ONLYTAGGED, "TAGGED_ONLY"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Delete Geometry. | * Delete Geometry. | ||||
| * | * | ||||
| * Utility operator to delete geometry. | * Utility operator to delete geometry. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_delete_def = { | static BMOpDefine bmo_delete_def = { | ||||
| "delete", | "delete", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | ||||
| {"context", BMO_OP_SLOT_INT}, /* enum DEL_VERTS ... */ | {"context", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_delete_context}, /* geometry types to delete */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| {{{'\0'}}}, /* no output */ | {{{'\0'}}}, /* no output */ | ||||
| bmo_delete_exec, | bmo_delete_exec, | ||||
| (BMO_OPTYPE_FLAG_NORMALS_CALC | | (BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | static BMOpDefine bmo_spin_def = { | ||||
| {{"geom_last.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* result of last step */ | {{"geom_last.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* result of last step */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_spin_exec, | bmo_spin_exec, | ||||
| (BMO_OPTYPE_FLAG_NORMALS_CALC | | (BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH), | BMO_OPTYPE_FLAG_SELECT_FLUSH), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_similar_faces_types[] = { | |||||
| {SIMFACE_MATERIAL, "MATERIAL"}, | |||||
| {SIMFACE_AREA, "AREA"}, | |||||
| {SIMFACE_SIDES, "SIDES"}, | |||||
| {SIMFACE_PERIMETER, "PERIMETER"}, | |||||
| {SIMFACE_NORMAL, "NORMAL"}, | |||||
| {SIMFACE_COPLANAR, "COPLANAR"}, | |||||
| {SIMFACE_SMOOTH, "SMOOTH"}, | |||||
| {SIMFACE_FACEMAP, "FACE_MAP"}, | |||||
| #ifdef WITH_FREESTYLE | |||||
| {SIMFACE_FREESTYLE, "FREESTYLE"}, | |||||
| #endif | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Similar Faces Search. | * Similar Faces Search. | ||||
| * | * | ||||
| * Find similar faces (area/material/perimeter, ...). | * Find similar faces (area/material/perimeter, ...). | ||||
| */ | */ | ||||
| static BMOpDefine bmo_similar_faces_def = { | static BMOpDefine bmo_similar_faces_def = { | ||||
| "similar_faces", | "similar_faces", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | ||||
| {"type", BMO_OP_SLOT_INT}, /* type of selection */ | {"type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_similar_faces_types}, /* type of selection */ | ||||
| {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | ||||
| {"compare", BMO_OP_SLOT_INT}, /* comparison method */ | {"compare", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_compare_types}, /* comparison method */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_similar_faces_exec, | bmo_similar_faces_exec, | ||||
| (BMO_OPTYPE_FLAG_SELECT_FLUSH), | (BMO_OPTYPE_FLAG_SELECT_FLUSH), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_similar_edges_types[] = { | |||||
| {SIMEDGE_LENGTH, "LENGTH"}, | |||||
| {SIMEDGE_DIR, "DIRECTION"}, | |||||
| {SIMEDGE_FACE, "FACE"}, | |||||
| {SIMEDGE_FACE_ANGLE, "FACE_ANGLE"}, | |||||
| {SIMEDGE_CREASE, "CREASE"}, | |||||
| {SIMEDGE_BEVEL, "BEVEL"}, | |||||
| {SIMEDGE_SEAM, "SEAM"}, | |||||
| {SIMEDGE_SHARP, "SHARP"}, | |||||
| #ifdef WITH_FREESTYLE | |||||
| {SIMEDGE_FREESTYLE, "FREESTYLE"}, | |||||
| #endif | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Similar Edges Search. | * Similar Edges Search. | ||||
| * | * | ||||
| * Find similar edges (length, direction, edge, seam, ...). | * Find similar edges (length, direction, edge, seam, ...). | ||||
| */ | */ | ||||
| static BMOpDefine bmo_similar_edges_def = { | static BMOpDefine bmo_similar_edges_def = { | ||||
| "similar_edges", | "similar_edges", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */ | {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */ | ||||
| {"type", BMO_OP_SLOT_INT}, /* type of selection */ | {"type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_similar_edges_types}, /* type of selection */ | ||||
| {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | ||||
| {"compare", BMO_OP_SLOT_INT}, /* comparison method */ | {"compare", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_compare_types}, /* comparison method */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ | {{"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_similar_edges_exec, | bmo_similar_edges_exec, | ||||
| (BMO_OPTYPE_FLAG_SELECT_FLUSH), | (BMO_OPTYPE_FLAG_SELECT_FLUSH), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_similar_verts_types[] = { | |||||
| {SIMVERT_NORMAL, "NORMAL"}, | |||||
| {SIMVERT_FACE, "FACE"}, | |||||
| {SIMVERT_VGROUP, "VERTEX_GROUP"}, | |||||
| {SIMVERT_EDGE, "EDGE"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Similar Verts Search. | * Similar Verts Search. | ||||
| * | * | ||||
| * Find similar vertices (normal, face, vertex group, ...). | * Find similar vertices (normal, face, vertex group, ...). | ||||
| */ | */ | ||||
| static BMOpDefine bmo_similar_verts_def = { | static BMOpDefine bmo_similar_verts_def = { | ||||
| "similar_verts", | "similar_verts", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */ | {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */ | ||||
| {"type", BMO_OP_SLOT_INT}, /* type of selection */ | {"type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_similar_verts_types}, /* type of selection */ | ||||
| {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | {"thresh", BMO_OP_SLOT_FLT}, /* threshold of selection */ | ||||
| {"compare", BMO_OP_SLOT_INT}, /* comparison method */ | {"compare", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_compare_types}, /* comparison method */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output vertices */ | {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output vertices */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_similar_verts_exec, | bmo_similar_verts_exec, | ||||
| (BMO_OPTYPE_FLAG_SELECT_FLUSH), | (BMO_OPTYPE_FLAG_SELECT_FLUSH), | ||||
| ▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | static BMOpDefine bmo_create_cube_def = { | ||||
| {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_create_cube_exec, | bmo_create_cube_exec, | ||||
| (BMO_OPTYPE_FLAG_NORMALS_CALC | | (BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH), | BMO_OPTYPE_FLAG_SELECT_FLUSH), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_bevel_offset_type[] = { | |||||
| {BEVEL_AMT_OFFSET, "OFFSET"}, | |||||
| {BEVEL_AMT_WIDTH, "WIDTH"}, | |||||
| {BEVEL_AMT_DEPTH, "DEPTH"}, | |||||
| {BEVEL_AMT_PERCENT, "PERCENT"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| static BMO_FlagSet bmo_enum_bevel_harden_normal_type[] = { | |||||
| {BEVEL_HN_NONE, "NONE"}, | |||||
| {BEVEL_HN_FACE, "FACE"}, | |||||
| {BEVEL_HN_ADJ, "ADJACENT"}, | |||||
| {BEVEL_HN_FIX_SHA, "FIXED_NORMAL_SHADING"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Bevel. | * Bevel. | ||||
| * | * | ||||
| * Bevels edges and vertices | * Bevels edges and vertices | ||||
| */ | */ | ||||
| static BMOpDefine bmo_bevel_def = { | static BMOpDefine bmo_bevel_def = { | ||||
| "bevel", | "bevel", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */ | {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* input edges and vertices */ | ||||
| {"offset", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */ | {"offset", BMO_OP_SLOT_FLT}, /* amount to offset beveled edge */ | ||||
| {"offset_type", BMO_OP_SLOT_INT}, /* how to measure offset (enum) */ | {"offset_type", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_bevel_offset_type}, /* how to measure the offset */ | ||||
| {"segments", BMO_OP_SLOT_INT}, /* number of segments in bevel */ | {"segments", BMO_OP_SLOT_INT}, /* number of segments in bevel */ | ||||
| {"profile", BMO_OP_SLOT_FLT}, /* profile shape, 0->1 (.5=>round) */ | {"profile", BMO_OP_SLOT_FLT}, /* profile shape, 0->1 (.5=>round) */ | ||||
| {"vertex_only", BMO_OP_SLOT_BOOL}, /* only bevel vertices, not edges */ | {"vertex_only", BMO_OP_SLOT_BOOL}, /* only bevel vertices, not edges */ | ||||
| {"clamp_overlap", BMO_OP_SLOT_BOOL}, /* do not allow beveled edges/vertices to overlap each other */ | {"clamp_overlap", BMO_OP_SLOT_BOOL}, /* do not allow beveled edges/vertices to overlap each other */ | ||||
| {"material", BMO_OP_SLOT_INT}, /* material for bevel faces, -1 means get from adjacent faces */ | {"material", BMO_OP_SLOT_INT}, /* material for bevel faces, -1 means get from adjacent faces */ | ||||
| {"loop_slide", BMO_OP_SLOT_BOOL}, /* prefer to slide along edges to having even widths */ | {"loop_slide", BMO_OP_SLOT_BOOL}, /* prefer to slide along edges to having even widths */ | ||||
| {"mark_seam", BMO_OP_SLOT_BOOL}, /* extend edge data to allow seams to run across bevels */ | {"mark_seam", BMO_OP_SLOT_BOOL}, /* extend edge data to allow seams to run across bevels */ | ||||
| {"mark_sharp", BMO_OP_SLOT_BOOL}, /* extend edge data to allow sharp edges to run across bevels */ | {"mark_sharp", BMO_OP_SLOT_BOOL}, /* extend edge data to allow sharp edges to run across bevels */ | ||||
| {"strength", BMO_OP_SLOT_FLT}, /* strength of calculated normal in range (0, 1) for custom clnors */ | {"strength", BMO_OP_SLOT_FLT}, /* strength of calculated normal in range (0, 1) for custom clnors */ | ||||
| {"hnmode", BMO_OP_SLOT_INT}, /* harden normals mode used in bevel if enabled */ | {"hnmode", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_bevel_harden_normal_type}, /* harden normals mode used in bevel, if enabled */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | ||||
| {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ | {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ | ||||
| {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | ||||
| {"normals.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* output normals per vertex for beveled edges */ | {"normals.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* output normals per vertex for beveled edges */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_bevel_exec, | bmo_bevel_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| BMO_OPTYPE_FLAG_NORMALS_CALC | | BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| /* no enum is defined for this */ | |||||
| static BMO_FlagSet bmo_enum_beautify_fill_method[] = { | |||||
| {0, "AREA"}, | |||||
| {1, "ANGLE"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Beautify Fill. | * Beautify Fill. | ||||
| * | * | ||||
| * Rotate edges to create more evenly spaced triangles. | * Rotate edges to create more evenly spaced triangles. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_beautify_fill_def = { | static BMOpDefine bmo_beautify_fill_def = { | ||||
| "beautify_fill", | "beautify_fill", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | ||||
| {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* edges that can be flipped */ | {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* edges that can be flipped */ | ||||
| {"use_restrict_tag", BMO_OP_SLOT_BOOL}, /* restrict edge rotation to mixed tagged vertices */ | {"use_restrict_tag", BMO_OP_SLOT_BOOL}, /* restrict edge rotation to mixed tagged vertices */ | ||||
| {"method", BMO_OP_SLOT_INT}, /* method to define what is beautiful */ | {"method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_beautify_fill_method}, /* method to define what is beautiful */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* new flipped faces and edges */ | {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* new flipped faces and edges */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_beautify_fill_exec, | bmo_beautify_fill_exec, | ||||
| (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | (BMO_OPTYPE_FLAG_UNTAN_MULTIRES | | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | static BMOpDefine bmo_wireframe_def = { | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_wireframe_exec, | bmo_wireframe_exec, | ||||
| (BMO_OPTYPE_FLAG_NORMALS_CALC | | (BMO_OPTYPE_FLAG_NORMALS_CALC | | ||||
| BMO_OPTYPE_FLAG_SELECT_FLUSH | | BMO_OPTYPE_FLAG_SELECT_FLUSH | | ||||
| BMO_OPTYPE_FLAG_SELECT_VALIDATE), | BMO_OPTYPE_FLAG_SELECT_VALIDATE), | ||||
| }; | }; | ||||
| static BMO_FlagSet bmo_enum_poke_center_mode[] = { | |||||
| {BMOP_POKE_MEAN_WEIGHTED, "MEAN_WEIGHTED"}, | |||||
| {BMOP_POKE_MEAN, "MEAN"}, | |||||
| {BMOP_POKE_BOUNDS, "BOUNDS"}, | |||||
| {0, NULL}, | |||||
| }; | |||||
| /* | /* | ||||
| * Pokes a face. | * Pokes a face. | ||||
| * | * | ||||
| * Splits a face into a triangle fan. | * Splits a face into a triangle fan. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_poke_def = { | static BMOpDefine bmo_poke_def = { | ||||
| "poke", | "poke", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */ | ||||
| {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */ | {"offset", BMO_OP_SLOT_FLT}, /* center vertex offset along normal */ | ||||
| {"center_mode", BMO_OP_SLOT_INT}, /* calculation mode for center vertex */ | {"center_mode", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_poke_center_mode}, /* calculation mode for center vertex */ | ||||
| {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* apply offset */ | {"use_relative_offset", BMO_OP_SLOT_BOOL}, /* apply offset */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | {{"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ | ||||
| {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | {"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| * symmetry are split as needed to enforce symmetry. | * symmetry are split as needed to enforce symmetry. | ||||
| * | * | ||||
| * All new vertices, edges, and faces are added to the "geom.out" slot. | * All new vertices, edges, and faces are added to the "geom.out" slot. | ||||
| */ | */ | ||||
| static BMOpDefine bmo_symmetrize_def = { | static BMOpDefine bmo_symmetrize_def = { | ||||
| "symmetrize", | "symmetrize", | ||||
| /* slots_in */ | /* slots_in */ | ||||
| {{"input", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | {{"input", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | ||||
| {"direction", BMO_OP_SLOT_INT}, | {"direction", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_axis_xyz}, /* axis to use */ | ||||
| {"dist", BMO_OP_SLOT_FLT}, /* minimum distance */ | {"dist", BMO_OP_SLOT_FLT}, /* minimum distance */ | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| /* slots_out */ | /* slots_out */ | ||||
| {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | {{"geom.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, | ||||
| {{'\0'}}, | {{'\0'}}, | ||||
| }, | }, | ||||
| bmo_symmetrize_exec, | bmo_symmetrize_exec, | ||||
| ▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines | |||||
would make this general axis enum to be reused.