[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52548] trunk/blender/source/blender: add subtypes to bmesh operators ( needed for python api to know how to convert return values).

Campbell Barton ideasman42 at gmail.com
Mon Nov 26 03:24:08 CET 2012


Revision: 52548
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52548
Author:   campbellbarton
Date:     2012-11-26 02:24:03 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
add subtypes to bmesh operators (needed for python api to know how to convert return values).

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c
    trunk/blender/source/blender/bmesh/intern/bmesh_operator_api.h
    trunk/blender/source/blender/bmesh/intern/bmesh_operators.c
    trunk/blender/source/blender/bmesh/intern/bmesh_operators.h
    trunk/blender/source/blender/python/bmesh/bmesh_py_ops.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c	2012-11-26 00:59:11 UTC (rev 52547)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_opdefines.c	2012-11-26 02:24:03 UTC (rev 52548)
@@ -100,39 +100,39 @@
 static BMOpDefine bmo_smooth_vert_def = {
 	"smooth_vert",
 	/* 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},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF},    /* input vertices */
+	 {"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 */
+	 {"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 */
+	{{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_smooth_vert_exec,
 	0
 };
 
 /*
- * 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
  */
 static BMOpDefine bmo_smooth_laplacian_vert_def = {
 	"smooth_laplacian_vert",
 	/* 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},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF},    /* input vertices */
+	 {"lambda", BMO_OP_SLOT_FLT},           /* lambda param */
+	 {"lambda_border", BMO_OP_SLOT_FLT},    /* lambda param in border */
+	 {"use_x", BMO_OP_SLOT_BOOL},           /* Smooth object along X axis */
+	 {"use_y", BMO_OP_SLOT_BOOL},           /* Smooth object along Y axis */
+	 {"use_z", BMO_OP_SLOT_BOOL},           /* Smooth object along Z axis */
+	 {"preserve_volume", BMO_OP_SLOT_BOOL}, /* Apply volume preservation after smooth */
+	{{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_smooth_laplacian_vert_exec,
 	0
 };
@@ -146,11 +146,11 @@
 static BMOpDefine bmo_recalc_face_normals_def = {
 	"recalc_face_normals",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
-	 {BMO_OP_SLOT_BOOL, "use_flip"},        /* internal flag, used by bmesh_rationalize_normals */
-	 {0},
+	{{"faces", BMO_OP_SLOT_ELEMENT_BUF},
+	 {"use_flip", BMO_OP_SLOT_BOOL},        /* internal flag, used by bmesh_rationalize_normals */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_recalc_face_normals_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES,
 };
@@ -168,14 +168,14 @@
 static BMOpDefine bmo_region_extend_def = {
 	"region_extend",
 	/* 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},
+	{{"geom", BMO_OP_SLOT_ELEMENT_BUF},     /* input geometry */
+	 {"use_constrict", BMO_OP_SLOT_BOOL},   /* find boundary inside the regions, not outside. */
+	 {"use_faces", BMO_OP_SLOT_BOOL},       /* extend from faces instead of edges */
+	 {{'\0'}},
 	},
 	/* slots_out */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, /* output slot, computed boundary geometry. */
-	 {0},
+	{{"geom.out", BMO_OP_SLOT_ELEMENT_BUF}, /* output slot, computed boundary geometry. */
+	 {{'\0'}},
 	},
 	bmo_region_extend_exec,
 	0
@@ -190,13 +190,13 @@
 static BMOpDefine bmo_rotate_edges_def = {
 	"rotate_edges",
 	/* 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},
+	{{"edges", BMO_OP_SLOT_ELEMENT_BUF},    /* input edges */
+	 {"use_ccw", BMO_OP_SLOT_BOOL},         /* rotate edge counter-clockwise if true, othewise clockwise */
+	 {{'\0'}},
 	},
 	/* slots_out */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "edges.out"}, /* newly spun edges */
-	 {0},
+	{{"edges.out", BMO_OP_SLOT_ELEMENT_BUF}, /* newly spun edges */
+	 {{'\0'}},
 	},
 	bmo_rotate_edges_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES
@@ -211,10 +211,10 @@
 static BMOpDefine bmo_reverse_faces_def = {
 	"reverse_faces",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},    /* input faces */
-	 {0},
+	{{"faces", BMO_OP_SLOT_ELEMENT_BUF},    /* input faces */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_reverse_faces_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES,
 };
@@ -228,13 +228,13 @@
 static BMOpDefine bmo_bisect_edges_def = {
 	"bisect_edges",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edges */
-	 {BMO_OP_SLOT_INT, "cuts"}, /* number of cuts */
-	 {0},
+	{{"edges", BMO_OP_SLOT_ELEMENT_BUF}, /* input edges */
+	 {"cuts", BMO_OP_SLOT_INT}, /* number of cuts */
+	 {{'\0'}},
 	},
 	/* slots_out */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geom_split.out"}, /* newly created vertices and edges */
-	 {0},
+	{{"geom_split.out", BMO_OP_SLOT_ELEMENT_BUF}, /* newly created vertices and edges */
+	 {{'\0'}},
 	},
 	bmo_bisect_edges_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES
@@ -251,17 +251,17 @@
 static BMOpDefine bmo_mirror_def = {
 	"mirror",
 	/* 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},
+	{{"geom", BMO_OP_SLOT_ELEMENT_BUF},     /* input geometry */
+	 {"mat",         BMO_OP_SLOT_MAT},      /* matrix defining the mirror transformation */
+	 {"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 */
+	 {"mirror_u",        BMO_OP_SLOT_BOOL}, /* mirror UVs across the u axis */
+	 {"mirror_v",        BMO_OP_SLOT_BOOL}, /* mirror UVs across the v axis */
+	 {{'\0'}},
 	},
 	/* slots_out */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "geom.out"}, /* output geometry, mirrored */
-	 {0},
+	{{"geom.out", BMO_OP_SLOT_ELEMENT_BUF}, /* output geometry, mirrored */
+	 {{'\0'}},
 	},
 	bmo_mirror_exec,
 	0,
@@ -279,14 +279,14 @@
 static BMOpDefine bmo_find_doubles_def = {
 	"find_doubles",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertices */
-	 {BMO_OP_SLOT_ELEMENT_BUF, "keep_verts"}, /* list of verts to keep */
-	 {BMO_OP_SLOT_FLT,         "dist"}, /* minimum distance */
-	 {0},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF}, /* input vertices */
+	 {"keep_verts", BMO_OP_SLOT_ELEMENT_BUF}, /* list of verts to keep */
+	 {"dist",         BMO_OP_SLOT_FLT}, /* minimum distance */
+	 {{'\0'}},
 	},
 	/* slots_out */
-	{{BMO_OP_SLOT_MAPPING, "targetmap.out"},
-	 {0},
+	{{"targetmap.out", BMO_OP_SLOT_MAPPING, BMO_OP_SLOT_SUBTYPE_MAP_ELEM},
+	 {{'\0'}},
 	},
 	bmo_find_doubles_exec,
 	0,
@@ -301,11 +301,11 @@
 static BMOpDefine bmo_remove_doubles_def = {
 	"remove_doubles",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input verts */
-	 {BMO_OP_SLOT_FLT,         "dist"}, /* minimum distance */
-	 {0},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF}, /* input verts */
+	 {"dist",         BMO_OP_SLOT_FLT}, /* minimum distance */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_remove_doubles_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES,
 };
@@ -320,11 +320,11 @@
 static BMOpDefine bmo_automerge_def = {
 	"automerge",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input verts */
-	 {BMO_OP_SLOT_FLT,         "dist"}, /* minimum distance */
-	 {0},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF}, /* input verts */
+	 {"dist",         BMO_OP_SLOT_FLT}, /* minimum distance */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_automerge_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES,
 };
@@ -337,10 +337,10 @@
 static BMOpDefine bmo_collapse_def = {
 	"collapse",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
-	 {0},
+	{{"edges", BMO_OP_SLOT_ELEMENT_BUF}, /* input edge */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_collapse_exec,
 	BMO_OP_FLAG_UNTAN_MULTIRES,
 };
@@ -354,11 +354,11 @@
 static BMOpDefine bmo_pointmerge_facedata_def = {
 	"pointmerge_facedata",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"},    /* input vertices */
-	 {BMO_OP_SLOT_ELEMENT_BUF, "snapv"},    /* snap vertex */
-	 {0},
+	{{"verts", BMO_OP_SLOT_ELEMENT_BUF},    /* input vertices */
+	 {"snapv", BMO_OP_SLOT_ELEMENT_BUF},    /* snap vertex */
+	 {{'\0'}},
 	},
-	{{0}},  /* no output */
+	{{{'\0'}}},  /* no output */
 	bmo_pointmerge_facedata_exec,
 	0,
 };
@@ -373,10 +373,10 @@
 static BMOpDefine bmo_average_vert_facedata_def = {
 	"average_vert_facedata",
 	/* slots_in */
-	{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, /* input vertice */
-	 {0},

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list