[Bf-blender-cvs] [fc05e2c0e07] master: Bmesh: Improve documentation of op parameters

Aaron Carlisle noreply at git.blender.org
Thu Dec 3 04:03:07 CET 2020


Commit: fc05e2c0e0763b47641414f718351799a18a9e24
Author: Aaron Carlisle
Date:   Wed Dec 2 22:01:00 2020 -0500
Branches: master
https://developer.blender.org/rBfc05e2c0e0763b47641414f718351799a18a9e24

Bmesh: Improve documentation of op parameters

These comments are used to generate Py API docs.
Most of the comments are just copies of the mesh operator counterparts.

More improvements can be made here in the future.

Thanks to Jon Denning on twitter:

https://twitter.com/gfxcoder/status/1334178566993555459

===================================================================

M	source/blender/bmesh/intern/bmesh_opdefines.c

===================================================================

diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 05b84ba21e2..a9d99466709 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -182,7 +182,7 @@ static BMOpDefine bmo_smooth_laplacian_vert_def = {
 static BMOpDefine bmo_recalc_face_normals_def = {
   "recalc_face_normals",
   /* slots_in */
-  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
    {{'\0'}},
   },
   {{{'\0'}}},  /* no output */
@@ -485,8 +485,7 @@ static BMOpDefine bmo_collapse_uvs_def = {
 static BMOpDefine bmo_weld_verts_def = {
   "weld_verts",
   /* slots_in */
-  /* maps welded vertices to verts they should weld to */
-  {{"targetmap", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}},
+  {{"targetmap", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* maps welded vertices to verts they should weld to */
    {{'\0'}},
   },
   {{{'\0'}}},  /* no output */
@@ -527,11 +526,11 @@ static BMOpDefine bmo_join_triangles_def = {
   "join_triangles",
   /* slots_in */
   {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},    /* input geometry. */
-   {"cmp_seam", BMO_OP_SLOT_BOOL},
-   {"cmp_sharp", BMO_OP_SLOT_BOOL},
-   {"cmp_uvs", BMO_OP_SLOT_BOOL},
-   {"cmp_vcols", BMO_OP_SLOT_BOOL},
-   {"cmp_materials", BMO_OP_SLOT_BOOL},
+   {"cmp_seam", BMO_OP_SLOT_BOOL}, /* Compare seam */
+   {"cmp_sharp", BMO_OP_SLOT_BOOL}, /* Compare sharp */
+   {"cmp_uvs", BMO_OP_SLOT_BOOL}, /* Compare UVs */
+   {"cmp_vcols", BMO_OP_SLOT_BOOL}, /* compare VCols */
+   {"cmp_materials", BMO_OP_SLOT_BOOL}, /* compare materials */
    {"angle_face_threshold", BMO_OP_SLOT_FLT},
    {"angle_shape_threshold", BMO_OP_SLOT_FLT},
    {{'\0'}},
@@ -587,9 +586,9 @@ static BMOpDefine bmo_bridge_loops_def = {
   {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
    {"use_pairs",          BMO_OP_SLOT_BOOL},
    {"use_cyclic",         BMO_OP_SLOT_BOOL},
-   {"use_merge",          BMO_OP_SLOT_BOOL},
-   {"merge_factor",       BMO_OP_SLOT_FLT},
-   {"twist_offset",       BMO_OP_SLOT_INT},
+   {"use_merge",          BMO_OP_SLOT_BOOL}, /* merge rather than creating faces */
+   {"merge_factor",       BMO_OP_SLOT_FLT}, /*  merge factor */
+   {"twist_offset",       BMO_OP_SLOT_INT}, /* twist offset for closed loops */
    {{'\0'}},
   },
   /* slots_out */
@@ -831,8 +830,8 @@ static BMOpDefine bmo_transform_def = {
 static BMOpDefine bmo_object_load_bmesh_def = {
   "object_load_bmesh",
   /* slots_in */
-  {{"scene", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_SCENE}},
-   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}},
+  {{"scene", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_SCENE}}, /* pointer to an scene structure */
+   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}}, /* pointer to an object structure */
    {{'\0'}},
   },
   {{{'\0'}}},  /* no output */
@@ -850,10 +849,8 @@ static BMOpDefine bmo_bmesh_to_mesh_def = {
   "bmesh_to_mesh",
   /* slots_in */
   {
-   /* pointer to a mesh structure to fill in */
-   {"mesh", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_MESH}},
-  /* pointer to an object structure */
-   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}},
+   {"mesh", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_MESH}}, /* pointer to a mesh structure to fill in */
+   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}}, /* pointer to an object structure */
    {{'\0'}},
   },
   {{{'\0'}}},  /* no output */
@@ -871,10 +868,8 @@ static BMOpDefine bmo_mesh_to_bmesh_def = {
   "mesh_to_bmesh",
   /* slots_in */
   {
-   /* pointer to a Mesh structure */
-   {"mesh", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_MESH}},
-  /* pointer to an Object structure */
-   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}},
+   {"mesh", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_MESH}}, /* pointer to a Mesh structure */
+   {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}}, /* pointer to an Object structure */
    {"use_shapekey", BMO_OP_SLOT_BOOL},  /* load active shapekey coordinates into verts */
    {{'\0'}},
   },
@@ -955,8 +950,8 @@ static BMOpDefine bmo_extrude_vert_indiv_def = {
 static BMOpDefine bmo_connect_verts_def = {
   "connect_verts",
   /* slots_in */
-  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-   {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
+   {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces to explicitly exclude from connecting */
    {"check_degenerate", BMO_OP_SLOT_BOOL},  /* prevent splits with overlaps & intersections */
    {{'\0'}},
   },
@@ -978,7 +973,7 @@ static BMOpDefine bmo_connect_verts_def = {
 static BMOpDefine bmo_connect_verts_concave_def = {
   "connect_verts_concave",
   /* slots_in */
-  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
    {{'\0'}},
   },
   /* slots_out */
@@ -1001,7 +996,7 @@ static BMOpDefine bmo_connect_verts_nonplanar_def = {
   "connect_verts_nonplanar",
   /* slots_in */
   {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
-   {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+   {"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
    {{'\0'}},
   },
   /* slots_out */
@@ -1023,9 +1018,9 @@ static BMOpDefine bmo_connect_verts_nonplanar_def = {
 static BMOpDefine bmo_connect_vert_pair_def = {
   "connect_vert_pair",
   /* slots_in */
-  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-   {"verts_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-   {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
+   {"verts_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices to explicitly exclude from connecting */
+   {"faces_exclude", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces to explicitly exclude from connecting */
    {{'\0'}},
   },
   /* slots_out */
@@ -1048,7 +1043,7 @@ static BMOpDefine bmo_extrude_face_region_def = {
   "extrude_face_region",
   /* slots_in */
   {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}},     /* edges and faces */
-   {"edges_exclude", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_EMPTY}},
+   {"edges_exclude", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_EMPTY}}, /* input edges to explicitly exclude from extrusion */
    {"use_keep_orig", BMO_OP_SLOT_BOOL},   /* keep original geometry (requires ``geom`` to include edges). */
    {"use_normal_flip", BMO_OP_SLOT_BOOL},  /* Create faces with reversed direction. */
    {"use_normal_from_adjacent", BMO_OP_SLOT_BOOL},  /* Use winding from surrounding faces instead of this region. */
@@ -1070,9 +1065,9 @@ static BMOpDefine bmo_extrude_face_region_def = {
 static BMOpDefine bmo_dissolve_verts_def = {
   "dissolve_verts",
   /* slots_in */
-  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-   {"use_face_split", BMO_OP_SLOT_BOOL},
-   {"use_boundary_tear", BMO_OP_SLOT_BOOL},
+  {{"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
+   {"use_face_split", BMO_OP_SLOT_BOOL}, /* split off face corners to maintain surrounding geometry */
+   {"use_boundary_tear", BMO_OP_SLOT_BOOL}, /* split off face corners instead of merging faces */
    {{'\0'}},
   },
   {{{'\0'}}},  /* no output */
@@ -1089,9 +1084,9 @@ static BMOpDefine bmo_dissolve_verts_def = {
 static BMOpDefine bmo_dissolve_edges_def = {
   "dissolve_edges",
   /* slots_in */
-  {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
+  {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
    {"use_verts", BMO_OP_SLOT_BOOL},  /* dissolve verts left between only 2 edges. */
-   {"use_face_split", BMO_OP_SLOT_BOOL},
+   {"use_face_split", BMO_OP_SLOT_BOOL}, /* split off face corners to maintain surrounding geometry */
    {{'\0'}},
   },
   /* slots_out */
@@ -1111,7 +1106,7 @@ static BMOpDefine bmo_dissolve_edges_def = {
 static BMOpDefine bmo_dissolve_faces_def = {
   "dissolve_faces",
   /* slots_in */
-  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
+  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
    {"use_verts", BMO_OP_SLOT_BOOL},  /* dissolve verts left between only 2 edges. */
    {{'\0'}},
   },
@@ -1144,10 +1139,10 @@ static BMOpDefine bmo_dissolve_limit_def = {
   "dissolve_limit",
   /* slots_in */
   {{"angle_limit", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
-   {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL},
-   {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}},
-   {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
-   {"delimit", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_FLAG}, bmo_enum_dissolve_limit_flags},
+   {"use_dissolve_boundaries", BMO_OP_SLOT_BOOL}, /* dissolve all vertices in between face boundaries */
+   {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* input vertices */
+   {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
+   {"delimit", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_FLAG}, bmo_enum_dissolve_limit_flags}, /* delimit dissolve operation */
    {{'\0'}},
   },
   /* slots_out */
@@ -1169,11 +1164,11 @@ static BMOpDefine bmo_dissolve_degenerate_def = {
   "dissolve_degenerate",
   /* slots_in */
   {{"dist", BMO_OP_SLOT_FLT}, /* maximum distance to consider degenerate */
-   {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}},
+   {"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */
    {{'\0'}},
   },
   /* slots_out */
-  {{{'\0'}}},
+  {{{'\0'}}},dissolve_degenerate
   bmo_dissolve_degenerate_exec,
   (BMO_OPTYPE_FLAG_UNTAN_MULTIRES |
    BMO_OPTYPE_FLAG_NORMALS_CALC |
@@ -1201,9 +1196,9 @@ static BMO_FlagSet bmo_enum_triangulate_ngon_method[] = {
 static BMOpDefine bmo_triangulate_def = {
   "triangulate",
   /* slots_in */
-  {{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}},
-   {"quad_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_triangulate_quad_method},
-   {"ngon_method", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list