[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52394] trunk/blender: code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values .

Campbell Barton ideasman42 at gmail.com
Tue Nov 20 06:50:26 CET 2012


Revision: 52394
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52394
Author:   campbellbarton
Date:     2012-11-20 05:50:19 +0000 (Tue, 20 Nov 2012)
Log Message:
-----------
code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.

all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c
    trunk/blender/source/blender/bmesh/intern/bmesh_operators.h
    trunk/blender/source/blender/bmesh/operators/bmo_bevel.c
    trunk/blender/source/blender/bmesh/operators/bmo_connect.c
    trunk/blender/source/blender/bmesh/operators/bmo_create.c
    trunk/blender/source/blender/bmesh/operators/bmo_dissolve.c
    trunk/blender/source/blender/bmesh/operators/bmo_dupe.c
    trunk/blender/source/blender/bmesh/operators/bmo_edgesplit.c
    trunk/blender/source/blender/bmesh/operators/bmo_extrude.c
    trunk/blender/source/blender/bmesh/operators/bmo_hull.c
    trunk/blender/source/blender/bmesh/operators/bmo_inset.c
    trunk/blender/source/blender/bmesh/operators/bmo_mesh_conv.c
    trunk/blender/source/blender/bmesh/operators/bmo_mirror.c
    trunk/blender/source/blender/bmesh/operators/bmo_primitive.c
    trunk/blender/source/blender/bmesh/operators/bmo_removedoubles.c
    trunk/blender/source/blender/bmesh/operators/bmo_similar.c
    trunk/blender/source/blender/bmesh/operators/bmo_slide.c
    trunk/blender/source/blender/bmesh/operators/bmo_smooth_laplacian.c
    trunk/blender/source/blender/bmesh/operators/bmo_subdivide.c
    trunk/blender/source/blender/bmesh/operators/bmo_symmetrize.c
    trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c
    trunk/blender/source/blender/bmesh/operators/bmo_utils.c
    trunk/blender/source/blender/bmesh/operators/bmo_wireframe.c
    trunk/blender/source/blender/editors/armature/editarmature.c
    trunk/blender/source/blender/editors/mesh/editmesh_add.c
    trunk/blender/source/blender/editors/mesh/editmesh_knife.c
    trunk/blender/source/blender/editors/mesh/editmesh_select.c
    trunk/blender/source/blender/editors/mesh/editmesh_slide.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/mesh/editmesh_utils.c
    trunk/blender/source/blender/makesdna/DNA_modifier_types.h
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/modifiers/intern/MOD_array.c
    trunk/blender/source/blender/modifiers/intern/MOD_laplaciansmooth.c
    trunk/blender/source/blender/modifiers/intern/MOD_skin.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2012-11-20 04:23:43 UTC (rev 52393)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2012-11-20 05:50:19 UTC (rev 52394)
@@ -1838,8 +1838,8 @@
 
         layout.separator()
 
-        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
-        layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
+        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
+        layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").use_ccw = True
 
         layout.separator()
 
@@ -1888,13 +1888,13 @@
 
         layout.separator()
 
-        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
+        layout.operator("mesh.edge_rotate", text="Rotate Edge CW").use_ccw = False
 
         layout.separator()
 
-        layout.operator_menu_enum("mesh.uvs_rotate", "direction")
+        layout.operator("mesh.uvs_rotate")
         layout.operator("mesh.uvs_reverse")
-        layout.operator_menu_enum("mesh.colors_rotate", "direction")
+        layout.operator("mesh.colors_rotate")
         layout.operator("mesh.colors_reverse")
 
 

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c	2012-11-20 04:23:43 UTC (rev 52393)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c	2012-11-20 05:50:19 UTC (rev 52394)
@@ -47,9 +47,9 @@
  * "in" (e.g. edgefacein).  for three-type slots, use geom.
  *
  * for output slots, for single-type geometry slots, use the type name plus "out",
- * (e.g. vertout), for double-type slots, use the two type names plus "out",
- * (e.g. vertfaceout), for three-type slots, use geom.  note that you can also
- * use more esohteric names (e.g. skirtout) so long as the comment next to the
+ * (e.g. verts.out), for double-type slots, use the two type names plus "out",
+ * (e.g. vertfaces.out), for three-type slots, use geom.  note that you can also
+ * use more esohteric names (e.g. geom_skirt.out) so long as the comment next to the
  * slot definition tells you what types of elements are in it.
  *
  */
@@ -82,7 +82,7 @@
  * would be extracted from comments
  * next to them, e.g.
  *
- * {BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output slot, boundary region
+ * {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
@@ -99,15 +99,16 @@
  */
 static BMOpDefine bmo_smooth_vert_def = {
 	"smooth_vert",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertices */
-	 {BMO_OP_SLOT_BOOL, "mirror_clip_x"}, /* set vertices close to the x axis before the operation to 0 */
-	 {BMO_OP_SLOT_BOOL, "mirror_clip_y"}, /* set vertices close to the y axis before the operation to 0 */
-	 {BMO_OP_SLOT_BOOL, "mirror_clip_z"}, /* set vertices close to the z axis before the operation to 0 */
-	 {BMO_OP_SLOT_FLT, "clipdist"}, /* clipping threshod for the above three slots */
-	 {BMO_OP_SLOT_BOOL, "use_axis_x"}, /* smooth vertices along X axis */
-	 {BMO_OP_SLOT_BOOL, "use_axis_y"}, /* smooth vertices along Y axis */
-	 {BMO_OP_SLOT_BOOL, "use_axis_z"}, /* smooth vertices along Z axis */
-	{0} /* null-terminating sentinel */,
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"},    /* input vertices */
+	 {BMO_OP_SLOT_BOOL, "mirror_clip_x"},   /* set vertices close to the x axis before the operation to 0 */
+	 {BMO_OP_SLOT_BOOL, "mirror_clip_y"},   /* set vertices close to the y axis before the operation to 0 */
+	 {BMO_OP_SLOT_BOOL, "mirror_clip_z"},   /* set vertices close to the z axis before the operation to 0 */
+	 {BMO_OP_SLOT_FLT,  "clip_dist"},       /* clipping threshod for the above three slots */
+	 {BMO_OP_SLOT_BOOL, "use_axis_x"},      /* smooth vertices along X axis */
+	 {BMO_OP_SLOT_BOOL, "use_axis_y"},      /* smooth vertices along Y axis */
+	 {BMO_OP_SLOT_BOOL, "use_axis_z"},      /* smooth vertices along Z axis */
+	{0},
 	},
 	{{0}},  /* no output */
 	bmo_smooth_vert_exec,
@@ -121,14 +122,15 @@
  */
 static BMOpDefine bmo_smooth_laplacian_vert_def = {
 	"smooth_laplacian_vert",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
-	 {BMO_OP_SLOT_FLT, "lambda"}, //lambda param
-	 {BMO_OP_SLOT_FLT, "lambda_border"}, //lambda param in border
-	 {BMO_OP_SLOT_BOOL, "use_x"}, //Smooth object along X axis
-	 {BMO_OP_SLOT_BOOL, "use_y"}, //Smooth object along Y axis
-	 {BMO_OP_SLOT_BOOL, "use_z"}, //Smooth object along Z axis
-	 {BMO_OP_SLOT_BOOL, "volume_preservation"}, //Apply volume preservation after smooth
-	{0} /* null-terminating sentinel */,
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"},    /* input vertices */
+	 {BMO_OP_SLOT_FLT, "lambda"},           /* lambda param */
+	 {BMO_OP_SLOT_FLT, "lambda_border"},    /* lambda param in border */
+	 {BMO_OP_SLOT_BOOL, "use_x"},           /* Smooth object along X axis */
+	 {BMO_OP_SLOT_BOOL, "use_y"},           /* Smooth object along Y axis */
+	 {BMO_OP_SLOT_BOOL, "use_z"},           /* Smooth object along Z axis */
+	 {BMO_OP_SLOT_BOOL, "preserve_volume"}, /* Apply volume preservation after smooth */
+	{0},
 	},
 	{{0}},  /* no output */
 	bmo_smooth_laplacian_vert_exec,
@@ -143,9 +145,10 @@
 
 static BMOpDefine bmo_recalc_face_normals_def = {
 	"recalc_face_normals",
+	/* slots_in */
 	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
-	 {BMO_OP_SLOT_BOOL, "do_flip"}, /* internal flag, used by bmesh_rationalize_normals */
-	 {0} /* null-terminating sentinel */,
+	 {BMO_OP_SLOT_BOOL, "use_flip"},        /* internal flag, used by bmesh_rationalize_normals */
+	 {0},
 	},
 	{{0}},  /* no output */
 	bmo_recalc_face_normals_exec,
@@ -157,20 +160,22 @@
  *
  * used to implement the select more/less tools.
  * this puts some geometry surrounding regions of
- * geometry in geom into geomout.
+ * geometry in geom into geom.out.
  *
- * if usefaces is 0 then geomout spits out verts and edges,
+ * if usefaces is 0 then geom.out spits out verts and edges,
  * otherwise it spits out faces.
  */
 static BMOpDefine bmo_region_extend_def = {
 	"region_extend",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input geometry */
-	 {BMO_OP_SLOT_BOOL, "constrict"}, /* find boundary inside the regions, not outside. */
-	 {BMO_OP_SLOT_BOOL, "use_faces"}, /* extend from faces instead of edges */
-	 {0} /* null-terminating sentinel */,
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "geom"},     /* input geometry */
+	 {BMO_OP_SLOT_BOOL, "use_constrict"},   /* find boundary inside the regions, not outside. */
+	 {BMO_OP_SLOT_BOOL, "use_faces"},       /* extend from faces instead of edges */
+	 {0},
 	},
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* output slot, computed boundary geometry. */
-	 {0} /* null-terminating sentinel */,
+	/* slots_out */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, /* output slot, computed boundary geometry. */
+	 {0},
 	},
 	bmo_region_extend_exec,
 	0
@@ -184,12 +189,14 @@
  */
 static BMOpDefine bmo_rotate_edges_def = {
 	"rotate_edges",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
-	 {BMO_OP_SLOT_BOOL, "ccw"}, /* rotate edge counter-clockwise if true, othewise clockwise */
-	 {0} /* null-terminating sentinel */,
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "edges"},    /* input edges */
+	 {BMO_OP_SLOT_BOOL, "use_ccw"},         /* rotate edge counter-clockwise if true, othewise clockwise */
+	 {0},
 	},
-	{{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, /* newly spun edges */
-	 {0} /* null-terminating sentinel */,
+	/* slots_out */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "edges.out"}, /* newly spun edges */
+	 {0},
 	},
 	bmo_rotate_edges_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES
@@ -203,8 +210,9 @@
  */
 static BMOpDefine bmo_reverse_faces_def = {
 	"reverse_faces",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, /* input faces */
-	 {0} /* null-terminating sentinel */,
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},    /* input faces */
+	 {0},
 	},
 	{{0}},  /* no output */
 	bmo_reverse_faces_exec,
@@ -219,12 +227,14 @@
  */
 static BMOpDefine bmo_bisect_edges_def = {
 	"bisect_edges",
+	/* slots_in */
 	{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
-	 {BMO_OP_SLOT_INT, "numcuts"}, /* number of cuts */
-	 {0} /* null-terminating sentinel */,
+	 {BMO_OP_SLOT_INT, "cuts"}, /* number of cuts */
+	 {0},
 	},
-	{{BMO_OP_SLOT_ELEMENT_BUF, "splitout"}, /* newly created vertices and edges */
-	 {0} /* null-terminating sentinel */,
+	/* slots_out */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "geom_split.out"}, /* newly created vertices and edges */
+	 {0},
 	},
 	bmo_bisect_edges_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES
@@ -234,22 +244,24 @@
  * Mirror
  *
  * Mirrors geometry along an axis.  The resulting geometry is welded on using
- * mergedist.  Pairs of original/mirrored vertices are welded using the mergedist
+ * 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",
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input geometry */
-	 {BMO_OP_SLOT_MAT, "mat"}, /* matrix defining the mirror transformation */
-	 {BMO_OP_SLOT_FLT, "mergedist"}, /* maximum distance for merging.  does no merging if 0. */
-	 {BMO_OP_SLOT_INT,         "axis"}, /* the axis to use, 0, 1, or 2 for x, y, z */
+	/* slots_in */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "geom"},     /* input geometry */
+	 {BMO_OP_SLOT_MAT,         "mat"},      /* matrix defining the mirror transformation */
+	 {BMO_OP_SLOT_FLT, "merge_dist"},       /* maximum distance for merging.  does no merging if 0. */
+	 {BMO_OP_SLOT_INT,         "axis"},     /* the axis to use, 0, 1, or 2 for x, y, z */
 	 {BMO_OP_SLOT_BOOL,        "mirror_u"}, /* mirror UVs across the u axis */
 	 {BMO_OP_SLOT_BOOL,        "mirror_v"}, /* mirror UVs across the v axis */
-	 {0} /* null-terminating sentinel */,
+	 {0},
 	},
-	{{BMO_OP_SLOT_ELEMENT_BUF, "newout"}, /* output geometry, mirrored */
-	 {0} /* null-terminating sentinel */,
+	/* slots_out */
+	{{BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, /* output geometry, mirrored */
+	 {0},
 	},
 	bmo_mirror_exec,
 	0,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list