forked from bartvdbraak/blender
added boolean type for bmesh operators, will make python wrapping clearer and also makes existing calls more obvious.
also corrected some error reports.
This commit is contained in:
parent
818e19713a
commit
1953f042e6
@ -528,7 +528,7 @@ BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob)
|
|||||||
|
|
||||||
bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
|
bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
|
||||||
|
|
||||||
BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", me, ob, 1);
|
BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", me, ob, TRUE);
|
||||||
|
|
||||||
return bm;
|
return bm;
|
||||||
}
|
}
|
||||||
|
@ -78,11 +78,12 @@ struct GHashIterator;
|
|||||||
/* slot type arrays are terminated by the last member
|
/* slot type arrays are terminated by the last member
|
||||||
* having a slot type of 0.*/
|
* having a slot type of 0.*/
|
||||||
#define BMO_OP_SLOT_SENTINEL 0
|
#define BMO_OP_SLOT_SENTINEL 0
|
||||||
#define BMO_OP_SLOT_INT 1
|
#define BMO_OP_SLOT_BOOL 1
|
||||||
#define BMO_OP_SLOT_FLT 2
|
#define BMO_OP_SLOT_INT 2
|
||||||
#define BMO_OP_SLOT_PNT 3
|
#define BMO_OP_SLOT_FLT 3
|
||||||
#define BMO_OP_SLOT_MAT 4
|
#define BMO_OP_SLOT_PNT 4
|
||||||
#define BMO_OP_SLOT_VEC 7
|
#define BMO_OP_SLOT_MAT 5
|
||||||
|
#define BMO_OP_SLOT_VEC 8
|
||||||
|
|
||||||
/* after BMO_OP_SLOT_VEC, everything is
|
/* after BMO_OP_SLOT_VEC, everything is
|
||||||
|
|
||||||
@ -91,9 +92,9 @@ struct GHashIterator;
|
|||||||
* for future growth.
|
* for future growth.
|
||||||
*/
|
*/
|
||||||
//it's very important this remain a power of two
|
//it's very important this remain a power of two
|
||||||
#define BMO_OP_SLOT_ELEMENT_BUF 8
|
#define BMO_OP_SLOT_ELEMENT_BUF 9
|
||||||
#define BMO_OP_SLOT_MAPPING 9
|
#define BMO_OP_SLOT_MAPPING 10
|
||||||
/* #define BMO_OP_SLOT_TOTAL_TYPES 10 */ /* not used yet */
|
#define BMO_OP_SLOT_TOTAL_TYPES 11
|
||||||
|
|
||||||
/* please ignore all these structures, don't touch them in tool code, except
|
/* please ignore all these structures, don't touch them in tool code, except
|
||||||
* for when your defining an operator with BMOpDefine.*/
|
* for when your defining an operator with BMOpDefine.*/
|
||||||
@ -199,7 +200,7 @@ int BMO_mesh_flag_count(struct BMesh *bm, const short oflag, const char htype);
|
|||||||
* this system is used to execute or initialize an operator,
|
* this system is used to execute or initialize an operator,
|
||||||
* using a formatted-string system.
|
* using a formatted-string system.
|
||||||
*
|
*
|
||||||
* for example, BMO_op_callf(bm, "del geom=%hf context=%d", BM_ELEM_SELECT, DEL_FACES);
|
* for example, BMO_op_callf(bm, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES);
|
||||||
* . . .will execute the delete operator, feeding in selected faces, deleting them.
|
* . . .will execute the delete operator, feeding in selected faces, deleting them.
|
||||||
*
|
*
|
||||||
* the basic format for the format string is:
|
* the basic format for the format string is:
|
||||||
@ -282,6 +283,8 @@ void BMO_slot_float_set(struct BMOperator *op, const char *slotname, const floa
|
|||||||
float BMO_slot_float_get(BMOperator *op, const char *slotname);
|
float BMO_slot_float_get(BMOperator *op, const char *slotname);
|
||||||
void BMO_slot_int_set(struct BMOperator *op, const char *slotname, const int i);
|
void BMO_slot_int_set(struct BMOperator *op, const char *slotname, const int i);
|
||||||
int BMO_slot_int_get(BMOperator *op, const char *slotname);
|
int BMO_slot_int_get(BMOperator *op, const char *slotname);
|
||||||
|
void BMO_slot_bool_set(struct BMOperator *op, const char *slotname, const int i);
|
||||||
|
int BMO_slot_bool_get(BMOperator *op, const char *slotname);
|
||||||
|
|
||||||
/* don't pass in arrays that are supposed to map to elements this way.
|
/* don't pass in arrays that are supposed to map to elements this way.
|
||||||
*
|
*
|
||||||
@ -448,7 +451,7 @@ typedef struct BMOElemMapping {
|
|||||||
int len;
|
int len;
|
||||||
} BMOElemMapping;
|
} BMOElemMapping;
|
||||||
|
|
||||||
extern const int BMO_OPSLOT_TYPEINFO[];
|
extern const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES];
|
||||||
|
|
||||||
BM_INLINE void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
|
BM_INLINE void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
|
||||||
void *element, void *data, int len)
|
void *element, void *data, int len)
|
||||||
|
@ -349,7 +349,7 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BMO_op_initf(bm, &bmop, "righthandfaces faces=%af doflip=%d", FALSE);
|
BMO_op_initf(bm, &bmop, "righthandfaces faces=%af do_flip=%b", FALSE);
|
||||||
|
|
||||||
BMO_push(bm, &bmop);
|
BMO_push(bm, &bmop);
|
||||||
bmesh_righthandfaces_exec(bm, &bmop);
|
bmesh_righthandfaces_exec(bm, &bmop);
|
||||||
|
@ -98,9 +98,9 @@
|
|||||||
static BMOpDefine def_vertexsmooth = {
|
static BMOpDefine def_vertexsmooth = {
|
||||||
"vertexsmooth",
|
"vertexsmooth",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
|
{{BMO_OP_SLOT_ELEMENT_BUF, "verts"}, //input vertices
|
||||||
{BMO_OP_SLOT_INT, "mirror_clip_x"}, //set vertices close to the x axis before the operation to 0
|
{BMO_OP_SLOT_BOOL, "mirror_clip_x"}, //set vertices close to the x axis before the operation to 0
|
||||||
{BMO_OP_SLOT_INT, "mirror_clip_y"}, //set vertices close to the y 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_INT, "mirror_clip_z"}, //set vertices close to the z 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_FLT, "clipdist"}, //clipping threshod for the above three slots
|
||||||
{0} /* null-terminating sentine */,
|
{0} /* null-terminating sentine */,
|
||||||
},
|
},
|
||||||
@ -117,7 +117,7 @@ static BMOpDefine def_vertexsmooth = {
|
|||||||
static BMOpDefine def_righthandfaces = {
|
static BMOpDefine def_righthandfaces = {
|
||||||
"righthandfaces",
|
"righthandfaces",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
|
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
|
||||||
{BMO_OP_SLOT_INT, "doflip"}, //internal flag, used by bmesh_rationalize_normals
|
{BMO_OP_SLOT_BOOL, "do_flip"}, //internal flag, used by bmesh_rationalize_normals
|
||||||
{0} /* null-terminating sentine */,
|
{0} /* null-terminating sentine */,
|
||||||
},
|
},
|
||||||
bmesh_righthandfaces_exec,
|
bmesh_righthandfaces_exec,
|
||||||
@ -138,8 +138,8 @@ static BMOpDefine def_regionextend = {
|
|||||||
"regionextend",
|
"regionextend",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, //input geometry
|
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, //input geometry
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output slot, computed boundary geometry.
|
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, //output slot, computed boundary geometry.
|
||||||
{BMO_OP_SLOT_INT, "constrict"}, //find boundary inside the regions, not outside.
|
{BMO_OP_SLOT_BOOL, "constrict"}, //find boundary inside the regions, not outside.
|
||||||
{BMO_OP_SLOT_INT, "usefaces"}, //extend from faces instead of edges
|
{BMO_OP_SLOT_BOOL, "use_faces"}, //extend from faces instead of edges
|
||||||
{0} /* null-terminating sentine */,
|
{0} /* null-terminating sentine */,
|
||||||
},
|
},
|
||||||
bmesh_regionextend_exec,
|
bmesh_regionextend_exec,
|
||||||
@ -156,7 +156,7 @@ static BMOpDefine def_edgerotate = {
|
|||||||
"edgerotate",
|
"edgerotate",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
|
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, //input edges
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //newly spun edges
|
{BMO_OP_SLOT_ELEMENT_BUF, "edgeout"}, //newly spun edges
|
||||||
{BMO_OP_SLOT_INT, "ccw"}, //rotate edge counter-clockwise if true, othewise clockwise
|
{BMO_OP_SLOT_BOOL, "ccw"}, //rotate edge counter-clockwise if true, othewise clockwise
|
||||||
{0} /* null-terminating sentine */,
|
{0} /* null-terminating sentine */,
|
||||||
},
|
},
|
||||||
bmesh_edgerotate_exec,
|
bmesh_edgerotate_exec,
|
||||||
@ -210,8 +210,8 @@ static BMOpDefine def_mirror = {
|
|||||||
{BMO_OP_SLOT_FLT, "mergedist"}, //maximum distance for merging. does no merging if 0.
|
{BMO_OP_SLOT_FLT, "mergedist"}, //maximum distance for merging. does no merging if 0.
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "newout"}, //output geometry, mirrored
|
{BMO_OP_SLOT_ELEMENT_BUF, "newout"}, //output geometry, mirrored
|
||||||
{BMO_OP_SLOT_INT, "axis"}, //the axis to use, 0, 1, or 2 for x, y, z
|
{BMO_OP_SLOT_INT, "axis"}, //the axis to use, 0, 1, or 2 for x, y, z
|
||||||
{BMO_OP_SLOT_INT, "mirror_u"}, //mirror UVs across the u axis
|
{BMO_OP_SLOT_BOOL, "mirror_u"}, //mirror UVs across the u axis
|
||||||
{BMO_OP_SLOT_INT, "mirror_v"}, //mirror UVs across the v axis
|
{BMO_OP_SLOT_BOOL, "mirror_v"}, //mirror UVs across the v axis
|
||||||
{0, /* null-terminating sentine */}},
|
{0, /* null-terminating sentine */}},
|
||||||
bmesh_mirror_exec,
|
bmesh_mirror_exec,
|
||||||
0,
|
0,
|
||||||
@ -375,10 +375,10 @@ static BMOpDefine def_join_triangles = {
|
|||||||
"join_triangles",
|
"join_triangles",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, //input geometry.
|
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"}, //input geometry.
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, //joined faces
|
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, //joined faces
|
||||||
{BMO_OP_SLOT_INT, "compare_sharp"},
|
{BMO_OP_SLOT_BOOL, "cmp_sharp"},
|
||||||
{BMO_OP_SLOT_INT, "compare_uvs"},
|
{BMO_OP_SLOT_BOOL, "cmp_uvs"},
|
||||||
{BMO_OP_SLOT_INT, "compare_vcols"},
|
{BMO_OP_SLOT_BOOL, "cmp_vcols"},
|
||||||
{BMO_OP_SLOT_INT, "compare_materials"},
|
{BMO_OP_SLOT_BOOL, "cmp_materials"},
|
||||||
{BMO_OP_SLOT_FLT, "limit"},
|
{BMO_OP_SLOT_FLT, "limit"},
|
||||||
{0, /* null-terminating sentine */}},
|
{0, /* null-terminating sentine */}},
|
||||||
bmesh_jointriangles_exec,
|
bmesh_jointriangles_exec,
|
||||||
@ -421,7 +421,7 @@ static BMOpDefine def_edgenet_fill = {
|
|||||||
"edgenet_fill",
|
"edgenet_fill",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
|
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"}, /* input edge */
|
||||||
{BMO_OP_SLOT_MAPPING, "restrict"}, /* restricts edges to groups. maps edges to integer */
|
{BMO_OP_SLOT_MAPPING, "restrict"}, /* restricts edges to groups. maps edges to integer */
|
||||||
{BMO_OP_SLOT_INT, "use_restrict"},
|
{BMO_OP_SLOT_BOOL, "use_restrict"},
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "excludefaces"}, /* list of faces to ignore for manifold check */
|
{BMO_OP_SLOT_ELEMENT_BUF, "excludefaces"}, /* list of faces to ignore for manifold check */
|
||||||
{BMO_OP_SLOT_MAPPING, "faceout_groupmap"}, /* maps new faces to the group numbers they came fro */
|
{BMO_OP_SLOT_MAPPING, "faceout_groupmap"}, /* maps new faces to the group numbers they came fro */
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* new face */
|
{BMO_OP_SLOT_ELEMENT_BUF, "faceout"}, /* new face */
|
||||||
@ -535,7 +535,7 @@ static BMOpDefine def_bmesh_to_mesh = {
|
|||||||
"bmesh_to_mesh",
|
"bmesh_to_mesh",
|
||||||
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a mesh structure to fill in
|
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a mesh structure to fill in
|
||||||
{BMO_OP_SLOT_PNT, "object"}, //pointer to an object structure
|
{BMO_OP_SLOT_PNT, "object"}, //pointer to an object structure
|
||||||
{BMO_OP_SLOT_INT, "notesselation"}, //don't calculate mfaces
|
{BMO_OP_SLOT_BOOL, "notesselation"}, //don't calculate mfaces
|
||||||
{0, /* null-terminating sentine */}},
|
{0, /* null-terminating sentine */}},
|
||||||
bmesh_to_mesh_exec,
|
bmesh_to_mesh_exec,
|
||||||
0,
|
0,
|
||||||
@ -551,7 +551,7 @@ static BMOpDefine def_mesh_to_bmesh = {
|
|||||||
"mesh_to_bmesh",
|
"mesh_to_bmesh",
|
||||||
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a Mesh structure
|
{{BMO_OP_SLOT_PNT, "mesh"}, //pointer to a Mesh structure
|
||||||
{BMO_OP_SLOT_PNT, "object"}, //pointer to an Object structure
|
{BMO_OP_SLOT_PNT, "object"}, //pointer to an Object structure
|
||||||
{BMO_OP_SLOT_INT, "set_shapekey"}, //load active shapekey coordinates into verts
|
{BMO_OP_SLOT_BOOL, "set_shapekey"}, //load active shapekey coordinates into verts
|
||||||
{0, /* null-terminating sentine */}},
|
{0, /* null-terminating sentine */}},
|
||||||
mesh_to_bmesh_exec,
|
mesh_to_bmesh_exec,
|
||||||
0
|
0
|
||||||
@ -615,7 +615,7 @@ static BMOpDefine def_extrudefaceregion = {
|
|||||||
"extrudefaceregion",
|
"extrudefaceregion",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "edgefacein"},
|
{{BMO_OP_SLOT_ELEMENT_BUF, "edgefacein"},
|
||||||
{BMO_OP_SLOT_MAPPING, "exclude"},
|
{BMO_OP_SLOT_MAPPING, "exclude"},
|
||||||
{BMO_OP_SLOT_INT, "alwayskeeporig"},
|
{BMO_OP_SLOT_BOOL, "alwayskeeporig"},
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"},
|
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"},
|
||||||
{0} /* null-terminating sentine */},
|
{0} /* null-terminating sentine */},
|
||||||
extrude_edge_context_exec,
|
extrude_edge_context_exec,
|
||||||
@ -634,7 +634,7 @@ static BMOpDefine def_dissolveedgessop = {
|
|||||||
"dissolveedges",
|
"dissolveedges",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"},
|
{{BMO_OP_SLOT_ELEMENT_BUF, "edges"},
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
|
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
|
||||||
{BMO_OP_SLOT_INT, "use_verts"}, // dissolve verts left between only 2 edges.
|
{BMO_OP_SLOT_BOOL, "use_verts"}, // dissolve verts left between only 2 edges.
|
||||||
{0} /* null-terminating sentine */},
|
{0} /* null-terminating sentine */},
|
||||||
dissolveedges_exec,
|
dissolveedges_exec,
|
||||||
BMO_OP_FLAG_UNTAN_MULTIRES
|
BMO_OP_FLAG_UNTAN_MULTIRES
|
||||||
@ -653,7 +653,7 @@ static BMOpDefine def_dissolvefacesop = {
|
|||||||
"dissolvefaces",
|
"dissolvefaces",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
|
{{BMO_OP_SLOT_ELEMENT_BUF, "faces"},
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
|
{BMO_OP_SLOT_ELEMENT_BUF, "regionout"},
|
||||||
{BMO_OP_SLOT_INT, "use_verts"}, // dissolve verts left between only 2 edges.
|
{BMO_OP_SLOT_BOOL, "use_verts"}, // dissolve verts left between only 2 edges.
|
||||||
{0} /* null-terminating sentine */},
|
{0} /* null-terminating sentine */},
|
||||||
dissolvefaces_exec,
|
dissolvefaces_exec,
|
||||||
BMO_OP_FLAG_UNTAN_MULTIRES
|
BMO_OP_FLAG_UNTAN_MULTIRES
|
||||||
@ -696,9 +696,9 @@ static BMOpDefine def_subdop = {
|
|||||||
{BMO_OP_SLOT_ELEMENT_BUF, "outsplit"},
|
{BMO_OP_SLOT_ELEMENT_BUF, "outsplit"},
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* contains all output geometr */
|
{BMO_OP_SLOT_ELEMENT_BUF, "geomout"}, /* contains all output geometr */
|
||||||
|
|
||||||
{BMO_OP_SLOT_INT, "quadcornertype"}, //quad corner type, see bmesh_operators.h
|
{BMO_OP_SLOT_INT, "quadcornertype"}, //quad corner type, see bmesh_operators.h
|
||||||
{BMO_OP_SLOT_INT, "gridfill"}, //fill in fully-selected faces with a grid
|
{BMO_OP_SLOT_BOOL, "gridfill"}, //fill in fully-selected faces with a grid
|
||||||
{BMO_OP_SLOT_INT, "singleedge"}, //tesselate the case of one edge selected in a quad or triangle
|
{BMO_OP_SLOT_BOOL, "singleedge"}, //tesselate the case of one edge selected in a quad or triangle
|
||||||
|
|
||||||
{0} /* null-terminating sentine */,
|
{0} /* null-terminating sentine */,
|
||||||
},
|
},
|
||||||
@ -708,7 +708,8 @@ static BMOpDefine def_subdop = {
|
|||||||
|
|
||||||
static BMOpDefine def_delop = {
|
static BMOpDefine def_delop = {
|
||||||
"del",
|
"del",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, {BMO_OP_SLOT_INT, "context"},
|
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"},
|
||||||
|
{BMO_OP_SLOT_INT, "context"},
|
||||||
{0} /* null-terminating sentine */},
|
{0} /* null-terminating sentine */},
|
||||||
delop_exec,
|
delop_exec,
|
||||||
0
|
0
|
||||||
@ -757,7 +758,7 @@ static BMOpDefine def_spinop = {
|
|||||||
{BMO_OP_SLOT_VEC, "dvec"}, /* translation delta per step */
|
{BMO_OP_SLOT_VEC, "dvec"}, /* translation delta per step */
|
||||||
{BMO_OP_SLOT_FLT, "ang"}, /* total rotation angle (degrees) */
|
{BMO_OP_SLOT_FLT, "ang"}, /* total rotation angle (degrees) */
|
||||||
{BMO_OP_SLOT_INT, "steps"}, /* number of steps */
|
{BMO_OP_SLOT_INT, "steps"}, /* number of steps */
|
||||||
{BMO_OP_SLOT_INT, "dupli"}, /* duplicate or extrude? */
|
{BMO_OP_SLOT_BOOL, "do_dupli"}, /* duplicate or extrude? */
|
||||||
{0} /* null-terminating sentine */},
|
{0} /* null-terminating sentine */},
|
||||||
spinop_exec,
|
spinop_exec,
|
||||||
0
|
0
|
||||||
@ -965,8 +966,8 @@ static BMOpDefine def_create_monkey = {
|
|||||||
static BMOpDefine def_create_cone = {
|
static BMOpDefine def_create_cone = {
|
||||||
"create_cone",
|
"create_cone",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
|
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
|
||||||
{BMO_OP_SLOT_INT, "cap_ends"}, //wheter or not to fill in the ends with faces
|
{BMO_OP_SLOT_BOOL, "cap_ends"}, //wheter or not to fill in the ends with faces
|
||||||
{BMO_OP_SLOT_INT, "cap_tris"}, //fill ends with triangles instead of ngons
|
{BMO_OP_SLOT_BOOL, "cap_tris"}, //fill ends with triangles instead of ngons
|
||||||
{BMO_OP_SLOT_INT, "segments"},
|
{BMO_OP_SLOT_INT, "segments"},
|
||||||
{BMO_OP_SLOT_FLT, "diameter1"}, //diameter of one end
|
{BMO_OP_SLOT_FLT, "diameter1"}, //diameter of one end
|
||||||
{BMO_OP_SLOT_FLT, "diameter2"}, //diameter of the opposite
|
{BMO_OP_SLOT_FLT, "diameter2"}, //diameter of the opposite
|
||||||
@ -983,8 +984,8 @@ static BMOpDefine def_create_cone = {
|
|||||||
static BMOpDefine def_create_circle = {
|
static BMOpDefine def_create_circle = {
|
||||||
"create_circle",
|
"create_circle",
|
||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
|
{{BMO_OP_SLOT_ELEMENT_BUF, "vertout"}, //output verts
|
||||||
{BMO_OP_SLOT_INT, "cap_ends"}, //wheter or not to fill in the ends with faces
|
{BMO_OP_SLOT_BOOL, "cap_ends"}, //wheter or not to fill in the ends with faces
|
||||||
{BMO_OP_SLOT_INT, "cap_tris"}, //fill ends with triangles instead of ngons
|
{BMO_OP_SLOT_BOOL, "cap_tris"}, //fill ends with triangles instead of ngons
|
||||||
{BMO_OP_SLOT_INT, "segments"},
|
{BMO_OP_SLOT_INT, "segments"},
|
||||||
{BMO_OP_SLOT_FLT, "diameter"}, //diameter of one end
|
{BMO_OP_SLOT_FLT, "diameter"}, //diameter of one end
|
||||||
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
|
{BMO_OP_SLOT_MAT, "mat"}, //matrix to multiply the new geometry with--
|
||||||
@ -1018,9 +1019,9 @@ static BMOpDefine def_bevel = {
|
|||||||
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input edges and vertices */
|
{{BMO_OP_SLOT_ELEMENT_BUF, "geom"}, /* input edges and vertices */
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "face_spans"}, /* new geometry */
|
{BMO_OP_SLOT_ELEMENT_BUF, "face_spans"}, /* new geometry */
|
||||||
{BMO_OP_SLOT_ELEMENT_BUF, "face_holes"}, /* new geometry */
|
{BMO_OP_SLOT_ELEMENT_BUF, "face_holes"}, /* new geometry */
|
||||||
{BMO_OP_SLOT_INT, "use_lengths"}, /* grab edge lengths from a PROP_FLT customdata laye */
|
{BMO_OP_SLOT_BOOL, "use_lengths"}, /* grab edge lengths from a PROP_FLT customdata laye */
|
||||||
{BMO_OP_SLOT_INT, "use_even"}, /* corner vert placement: use shell/angle calculations */
|
{BMO_OP_SLOT_BOOL, "use_even"}, /* corner vert placement: use shell/angle calculations */
|
||||||
{BMO_OP_SLOT_INT, "use_dist"}, /* corner vert placement: evaluate percent as a distance,
|
{BMO_OP_SLOT_BOOL, "use_dist"}, /* corner vert placement: evaluate percent as a distance,
|
||||||
* modifier uses this. We could do this as another float setting */
|
* modifier uses this. We could do this as another float setting */
|
||||||
{BMO_OP_SLOT_INT, "lengthlayer"}, /* which PROP_FLT layer to us */
|
{BMO_OP_SLOT_INT, "lengthlayer"}, /* which PROP_FLT layer to us */
|
||||||
{BMO_OP_SLOT_FLT, "percent"}, /* percentage to expand bevelled edge */
|
{BMO_OP_SLOT_FLT, "percent"}, /* percentage to expand bevelled edge */
|
||||||
|
@ -63,8 +63,9 @@ static const char *bmo_error_messages[] = {
|
|||||||
|
|
||||||
|
|
||||||
/* operator slot type information - size of one element of the type given. */
|
/* operator slot type information - size of one element of the type given. */
|
||||||
const int BMO_OPSLOT_TYPEINFO[] = {
|
const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES] = {
|
||||||
0,
|
0,
|
||||||
|
sizeof(int),
|
||||||
sizeof(int),
|
sizeof(int),
|
||||||
sizeof(float),
|
sizeof(float),
|
||||||
sizeof(void *),
|
sizeof(void *),
|
||||||
@ -324,6 +325,15 @@ void BMO_slot_int_set(BMOperator *op, const char *slotname, const int i)
|
|||||||
slot->data.i = i;
|
slot->data.i = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BMO_slot_bool_set(BMOperator *op, const char *slotname, const int i)
|
||||||
|
{
|
||||||
|
BMOpSlot *slot = BMO_slot_get(op, slotname);
|
||||||
|
if (!(slot->slottype == BMO_OP_SLOT_BOOL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
slot->data.i = i;
|
||||||
|
}
|
||||||
|
|
||||||
/* only supports square mats */
|
/* only supports square mats */
|
||||||
void BMO_slot_mat_set(struct BMOperator *op, const char *slotname, const float *mat, int size)
|
void BMO_slot_mat_set(struct BMOperator *op, const char *slotname, const float *mat, int size)
|
||||||
{
|
{
|
||||||
@ -402,6 +412,15 @@ int BMO_slot_int_get(BMOperator *op, const char *slotname)
|
|||||||
return slot->data.i;
|
return slot->data.i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int BMO_slot_bool_get(BMOperator *op, const char *slotname)
|
||||||
|
{
|
||||||
|
BMOpSlot *slot = BMO_slot_get(op, slotname);
|
||||||
|
if (!(slot->slottype == BMO_OP_SLOT_BOOL))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return slot->data.i;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void *BMO_slot_ptr_get(BMOperator *op, const char *slotname)
|
void *BMO_slot_ptr_get(BMOperator *op, const char *slotname)
|
||||||
{
|
{
|
||||||
@ -1102,19 +1121,6 @@ int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op)
|
|||||||
return errorcode;
|
return errorcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* example:
|
|
||||||
* BMO_CallOp(bm, "del %d %hv", DEL_ONLYFACES, BM_ELEM_SELECT);
|
|
||||||
*
|
|
||||||
* d - int
|
|
||||||
* i - int
|
|
||||||
* f - float
|
|
||||||
* hv - header flagged verts
|
|
||||||
* he - header flagged edges
|
|
||||||
* hf - header flagged faces
|
|
||||||
* fv - flagged verts
|
|
||||||
* fe - flagged edges
|
|
||||||
* ff - flagged faces
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NEXT_CHAR(fmt) ((fmt)[0] != 0 ? (fmt)[1] : 0)
|
#define NEXT_CHAR(fmt) ((fmt)[0] != 0 ? (fmt)[1] : 0)
|
||||||
|
|
||||||
@ -1155,6 +1161,20 @@ static int bmesh_opname_to_opcode(const char *opname)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Example:
|
||||||
|
* BMO_op_callf(bm, "del %i %hv", DEL_ONLYFACES, BM_ELEM_SELECT);
|
||||||
|
*
|
||||||
|
* i - int
|
||||||
|
* b - boolean (same as int but 1/0 only)
|
||||||
|
* f - float
|
||||||
|
* hv - header flagged verts (hflag)
|
||||||
|
* he - header flagged edges (hflag)
|
||||||
|
* hf - header flagged faces (hflag)
|
||||||
|
* fv - flagged verts (oflag)
|
||||||
|
* fe - flagged edges (oflag)
|
||||||
|
* ff - flagged faces (oflag)
|
||||||
|
*/
|
||||||
|
|
||||||
int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
|
int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
|
||||||
{
|
{
|
||||||
BMOpDefine *def;
|
BMOpDefine *def;
|
||||||
@ -1265,10 +1285,13 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'd':
|
|
||||||
BMO_slot_int_set(op, slotname, va_arg(vlist, int));
|
BMO_slot_int_set(op, slotname, va_arg(vlist, int));
|
||||||
state = 1;
|
state = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'b':
|
||||||
|
BMO_slot_bool_set(op, slotname, va_arg(vlist, int));
|
||||||
|
state = 1;
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
BMO_slot_ptr_set(op, slotname, va_arg(vlist, void *));
|
BMO_slot_ptr_set(op, slotname, va_arg(vlist, void *));
|
||||||
state = 1;
|
state = 1;
|
||||||
|
@ -190,11 +190,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
|
|||||||
BLI_array_declare(edges);
|
BLI_array_declare(edges);
|
||||||
SmallHash hash;
|
SmallHash hash;
|
||||||
float fac = BMO_slot_float_get(op, "percent");
|
float fac = BMO_slot_float_get(op, "percent");
|
||||||
const short do_even = BMO_slot_int_get(op, "use_even");
|
const short do_even = BMO_slot_bool_get(op, "use_even");
|
||||||
const short do_dist = BMO_slot_int_get(op, "use_dist");
|
const short do_dist = BMO_slot_bool_get(op, "use_dist");
|
||||||
int i, li, has_elens, HasMDisps = CustomData_has_layer(&bm->ldata, CD_MDISPS);
|
int i, li, has_elens, HasMDisps = CustomData_has_layer(&bm->ldata, CD_MDISPS);
|
||||||
|
|
||||||
has_elens = CustomData_has_layer(&bm->edata, CD_PROP_FLT) && BMO_slot_int_get(op, "use_lengths");
|
has_elens = CustomData_has_layer(&bm->edata, CD_PROP_FLT) && BMO_slot_bool_get(op, "use_lengths");
|
||||||
if (has_elens) {
|
if (has_elens) {
|
||||||
li = BMO_slot_int_get(op, "lengthlayer");
|
li = BMO_slot_int_get(op, "lengthlayer");
|
||||||
}
|
}
|
||||||
|
@ -872,7 +872,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMEdge **edges = NULL;
|
BMEdge **edges = NULL;
|
||||||
PathBase *pathbase = edge_pathbase_new();
|
PathBase *pathbase = edge_pathbase_new();
|
||||||
BLI_array_declare(edges);
|
BLI_array_declare(edges);
|
||||||
int use_restrict = BMO_slot_int_get(op, "use_restrict");
|
int use_restrict = BMO_slot_bool_get(op, "use_restrict");
|
||||||
int i, j, group = 0;
|
int i, j, group = 0;
|
||||||
unsigned int winding[2]; /* accumulte winding directions for each edge which has a face */
|
unsigned int winding[2]; /* accumulte winding directions for each edge which has a face */
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMWalker regwalker;
|
BMWalker regwalker;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
int use_verts = BMO_slot_int_get(op, "use_verts");
|
int use_verts = BMO_slot_bool_get(op, "use_verts");
|
||||||
|
|
||||||
if (use_verts) {
|
if (use_verts) {
|
||||||
/* tag verts that start out with only 2 edges,
|
/* tag verts that start out with only 2 edges,
|
||||||
@ -160,7 +160,7 @@ void dissolvefaces_exec(BMesh *bm, BMOperator *op)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BMO_op_callf(bm, "del geom=%ff context=%d", FACE_ORIG, DEL_FACES);
|
BMO_op_callf(bm, "del geom=%ff context=%i", FACE_ORIG, DEL_FACES);
|
||||||
|
|
||||||
|
|
||||||
if (use_verts) {
|
if (use_verts) {
|
||||||
@ -247,7 +247,7 @@ void dissolveedges_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMIter viter;
|
BMIter viter;
|
||||||
BMVert *v;
|
BMVert *v;
|
||||||
|
|
||||||
int use_verts = BMO_slot_int_get(op, "use_verts");
|
int use_verts = BMO_slot_bool_get(op, "use_verts");
|
||||||
|
|
||||||
if (use_verts) {
|
if (use_verts) {
|
||||||
BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
|
BM_ITER(v, &viter, bm, BM_VERTS_OF_MESH, NULL) {
|
||||||
|
@ -468,7 +468,7 @@ void spinop_exec(BMesh *bm, BMOperator *op)
|
|||||||
float q[4];
|
float q[4];
|
||||||
float rmat[3][3];
|
float rmat[3][3];
|
||||||
float phi, si;
|
float phi, si;
|
||||||
int steps, dupli, a, usedvec;
|
int steps, do_dupli, a, usedvec;
|
||||||
|
|
||||||
BMO_slot_vec_get(op, "cent", cent);
|
BMO_slot_vec_get(op, "cent", cent);
|
||||||
BMO_slot_vec_get(op, "axis", axis);
|
BMO_slot_vec_get(op, "axis", axis);
|
||||||
@ -477,7 +477,7 @@ void spinop_exec(BMesh *bm, BMOperator *op)
|
|||||||
usedvec = !is_zero_v3(dvec);
|
usedvec = !is_zero_v3(dvec);
|
||||||
steps = BMO_slot_int_get(op, "steps");
|
steps = BMO_slot_int_get(op, "steps");
|
||||||
phi = BMO_slot_float_get(op, "ang") * (float)M_PI / (360.0f * steps);
|
phi = BMO_slot_float_get(op, "ang") * (float)M_PI / (360.0f * steps);
|
||||||
dupli = BMO_slot_int_get(op, "dupli");
|
do_dupli = BMO_slot_bool_get(op, "do_dupli");
|
||||||
|
|
||||||
si = (float)sin(phi);
|
si = (float)sin(phi);
|
||||||
q[0] = (float)cos(phi);
|
q[0] = (float)cos(phi);
|
||||||
@ -488,7 +488,7 @@ void spinop_exec(BMesh *bm, BMOperator *op)
|
|||||||
|
|
||||||
BMO_slot_copy(op, op, "geom", "lastout");
|
BMO_slot_copy(op, op, "geom", "lastout");
|
||||||
for (a = 0; a < steps; a++) {
|
for (a = 0; a < steps; a++) {
|
||||||
if (dupli) {
|
if (do_dupli) {
|
||||||
BMO_op_initf(bm, &dupop, "dupe geom=%s", op, "lastout");
|
BMO_op_initf(bm, &dupop, "dupe geom=%s", op, "lastout");
|
||||||
BMO_op_exec(bm, &dupop);
|
BMO_op_exec(bm, &dupop);
|
||||||
BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s",
|
BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s",
|
||||||
|
@ -107,7 +107,7 @@ void bmesh_extrude_face_indiv_exec(BMesh *bm, BMOperator *op)
|
|||||||
|
|
||||||
BLI_array_free(edges);
|
BLI_array_free(edges);
|
||||||
|
|
||||||
BMO_op_callf(bm, "del geom=%ff context=%d", EXT_DEL, DEL_ONLYFACES);
|
BMO_op_callf(bm, "del geom=%ff context=%i", EXT_DEL, DEL_ONLYFACES);
|
||||||
BMO_slot_from_flag(bm, op, "faceout", EXT_KEEP, BM_FACE);
|
BMO_slot_from_flag(bm, op, "faceout", EXT_KEEP, BM_FACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ void extrude_edge_context_exec(BMesh *bm, BMOperator *op)
|
|||||||
|
|
||||||
/* if one flagged face is bordered by an unflagged face, then we delete
|
/* if one flagged face is bordered by an unflagged face, then we delete
|
||||||
* original geometry unless caller explicitly asked to keep it. */
|
* original geometry unless caller explicitly asked to keep it. */
|
||||||
if (!BMO_slot_int_get(op, "alwayskeeporig")) {
|
if (!BMO_slot_bool_get(op, "alwayskeeporig")) {
|
||||||
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
|
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
|
||||||
if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) continue;
|
if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) continue;
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ void extrude_edge_context_exec(BMesh *bm, BMOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (delorig) {
|
if (delorig) {
|
||||||
BMO_op_initf(bm, &delop, "del geom=%fvef context=%d",
|
BMO_op_initf(bm, &delop, "del geom=%fvef context=%i",
|
||||||
EXT_DEL, DEL_ONLYTAGGED);
|
EXT_DEL, DEL_ONLYTAGGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,7 +576,7 @@ void bmesh_solidify_face_region_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMO_op_finish(bm, &reverseop);
|
BMO_op_finish(bm, &reverseop);
|
||||||
|
|
||||||
/* Extrude the region */
|
/* Extrude the region */
|
||||||
BMO_op_initf(bm, &extrudeop, "extrudefaceregion alwayskeeporig=%i", TRUE);
|
BMO_op_initf(bm, &extrudeop, "extrudefaceregion alwayskeeporig=%b", TRUE);
|
||||||
BMO_slot_copy(op, &extrudeop, "geom", "edgefacein");
|
BMO_slot_copy(op, &extrudeop, "geom", "edgefacein");
|
||||||
BMO_op_exec(bm, &extrudeop);
|
BMO_op_exec(bm, &extrudeop);
|
||||||
|
|
||||||
|
@ -231,8 +231,10 @@ void bmesh_jointriangles_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMEdge *e;
|
BMEdge *e;
|
||||||
BLI_array_declare(jedges);
|
BLI_array_declare(jedges);
|
||||||
JoinEdge *jedges = NULL;
|
JoinEdge *jedges = NULL;
|
||||||
int dosharp = BMO_slot_int_get(op, "compare_sharp"), douvs = BMO_slot_int_get(op, "compare_uvs");
|
int dosharp = BMO_slot_bool_get(op, "cmp_sharp");
|
||||||
int dovcols = BMO_slot_int_get(op, "compare_vcols"), domat = BMO_slot_int_get(op, "compare_materials");
|
int douvs = BMO_slot_bool_get(op, "cmp_uvs");
|
||||||
|
int dovcols = BMO_slot_bool_get(op, "cmp_vcols");
|
||||||
|
int domat = BMO_slot_bool_get(op, "cmp_materials");
|
||||||
float limit = BMO_slot_float_get(op, "limit");
|
float limit = BMO_slot_float_get(op, "limit");
|
||||||
int i, totedge;
|
int i, totedge;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
|
|||||||
BLI_array_declare(fedges);
|
BLI_array_declare(fedges);
|
||||||
float (*keyco)[3] = NULL;
|
float (*keyco)[3] = NULL;
|
||||||
int *keyi;
|
int *keyi;
|
||||||
int set_key = BMO_slot_int_get(op, "set_shapekey");
|
int set_key = BMO_slot_bool_get(op, "set_shapekey");
|
||||||
int totuv, i, j;
|
int totuv, i, j;
|
||||||
|
|
||||||
if (!me || !me->totvert) {
|
if (!me || !me->totvert) {
|
||||||
@ -370,7 +370,7 @@ void object_load_bmesh_exec(BMesh *bm, BMOperator *op)
|
|||||||
/* Scene *scene = BMO_slot_ptr_get(op, "scene"); */
|
/* Scene *scene = BMO_slot_ptr_get(op, "scene"); */
|
||||||
Mesh *me = ob->data;
|
Mesh *me = ob->data;
|
||||||
|
|
||||||
BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notesselation=%i", me, ob, TRUE);
|
BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notesselation=%b", me, ob, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMFace *f;
|
BMFace *f;
|
||||||
BMIter iter, liter;
|
BMIter iter, liter;
|
||||||
int i, j, *keyi, ototvert, totloop;
|
int i, j, *keyi, ototvert, totloop;
|
||||||
int dotess = !BMO_slot_int_get(op, "notesselation");
|
int dotess = !BMO_slot_bool_get(op, "notesselation");
|
||||||
|
|
||||||
ototvert = me->totvert;
|
ototvert = me->totvert;
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ void bmesh_mirror_exec(BMesh *bm, BMOperator *op)
|
|||||||
float scale[3] = {1.0f, 1.0f, 1.0f};
|
float scale[3] = {1.0f, 1.0f, 1.0f};
|
||||||
float dist = BMO_slot_float_get(op, "mergedist");
|
float dist = BMO_slot_float_get(op, "mergedist");
|
||||||
int i, ototvert, ototedge, axis = BMO_slot_int_get(op, "axis");
|
int i, ototvert, ototedge, axis = BMO_slot_int_get(op, "axis");
|
||||||
int mirroru = BMO_slot_int_get(op, "mirror_u");
|
int mirroru = BMO_slot_bool_get(op, "mirror_u");
|
||||||
int mirrorv = BMO_slot_int_get(op, "mirror_v");
|
int mirrorv = BMO_slot_bool_get(op, "mirror_v");
|
||||||
|
|
||||||
ototvert = bm->totvert;
|
ototvert = bm->totvert;
|
||||||
ototedge = bm->totedge;
|
ototedge = bm->totedge;
|
||||||
|
@ -495,8 +495,9 @@ void bmesh_create_circle_exec(BMesh *bm, BMOperator *op)
|
|||||||
BMVert *v1, *lastv1 = NULL, *cent1, *firstv1 = NULL;
|
BMVert *v1, *lastv1 = NULL, *cent1, *firstv1 = NULL;
|
||||||
float vec[3], mat[4][4], phi, phid;
|
float vec[3], mat[4][4], phi, phid;
|
||||||
float dia = BMO_slot_float_get(op, "diameter");
|
float dia = BMO_slot_float_get(op, "diameter");
|
||||||
int cap_ends = BMO_slot_int_get(op, "cap_ends"), segs = BMO_slot_int_get(op, "segments");
|
int segs = BMO_slot_int_get(op, "segments");
|
||||||
int cap_tris = BMO_slot_int_get(op, "cap_tris");
|
int cap_ends = BMO_slot_bool_get(op, "cap_ends");
|
||||||
|
int cap_tris = BMO_slot_bool_get(op, "cap_tris");
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
if (!segs)
|
if (!segs)
|
||||||
@ -567,8 +568,9 @@ void bmesh_create_cone_exec(BMesh *bm, BMOperator *op)
|
|||||||
float dia1 = BMO_slot_float_get(op, "diameter1");
|
float dia1 = BMO_slot_float_get(op, "diameter1");
|
||||||
float dia2 = BMO_slot_float_get(op, "diameter2");
|
float dia2 = BMO_slot_float_get(op, "diameter2");
|
||||||
float depth = BMO_slot_float_get(op, "depth");
|
float depth = BMO_slot_float_get(op, "depth");
|
||||||
int cap_ends = BMO_slot_int_get(op, "cap_ends"), segs = BMO_slot_int_get(op, "segments");
|
int segs = BMO_slot_int_get(op, "segments");
|
||||||
int cap_tris = BMO_slot_int_get(op, "cap_tris");
|
int cap_ends = BMO_slot_bool_get(op, "cap_ends");
|
||||||
|
int cap_tris = BMO_slot_bool_get(op, "cap_tris");
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
if (!segs)
|
if (!segs)
|
||||||
|
@ -693,8 +693,8 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op)
|
|||||||
fractal = BMO_slot_float_get(op, "fractal");
|
fractal = BMO_slot_float_get(op, "fractal");
|
||||||
beauty = BMO_slot_int_get(op, "beauty");
|
beauty = BMO_slot_int_get(op, "beauty");
|
||||||
cornertype = BMO_slot_int_get(op, "quadcornertype");
|
cornertype = BMO_slot_int_get(op, "quadcornertype");
|
||||||
singleedge = BMO_slot_int_get(op, "singleedge");
|
singleedge = BMO_slot_bool_get(op, "singleedge");
|
||||||
gridfill = BMO_slot_int_get(op, "gridfill");
|
gridfill = BMO_slot_bool_get(op, "gridfill");
|
||||||
|
|
||||||
BLI_srandom(seed);
|
BLI_srandom(seed);
|
||||||
|
|
||||||
@ -1022,8 +1022,8 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s
|
|||||||
BMOperator op;
|
BMOperator op;
|
||||||
|
|
||||||
BMO_op_initf(bm, &op, "esubd edges=%he smooth=%f fractal=%f "
|
BMO_op_initf(bm, &op, "esubd edges=%he smooth=%f fractal=%f "
|
||||||
"beauty=%d numcuts=%d quadcornertype=%d singleedge=%d "
|
"beauty=%i numcuts=%i quadcornertype=%i singleedge=%b "
|
||||||
"gridfill=%d seed=%d",
|
"gridfill=%b seed=%i",
|
||||||
flag, smooth, fractal, beauty, numcuts,
|
flag, smooth, fractal, beauty, numcuts,
|
||||||
cornertype, singleedge, gridfill, seed);
|
cornertype, singleedge, gridfill, seed);
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void bmesh_edgerotate_exec(BMesh *bm, BMOperator *op)
|
|||||||
{
|
{
|
||||||
BMOIter siter;
|
BMOIter siter;
|
||||||
BMEdge *e, *e2;
|
BMEdge *e, *e2;
|
||||||
int ccw = BMO_slot_int_get(op, "ccw");
|
int ccw = BMO_slot_bool_get(op, "ccw");
|
||||||
|
|
||||||
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
|
BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
|
||||||
if (!(e2 = BM_edge_rotate(bm, e, ccw))) {
|
if (!(e2 = BM_edge_rotate(bm, e, ccw))) {
|
||||||
@ -221,15 +221,15 @@ static void bmesh_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces
|
|||||||
|
|
||||||
void bmesh_regionextend_exec(BMesh *bm, BMOperator *op)
|
void bmesh_regionextend_exec(BMesh *bm, BMOperator *op)
|
||||||
{
|
{
|
||||||
int usefaces = BMO_slot_int_get(op, "usefaces");
|
int use_faces = BMO_slot_bool_get(op, "use_faces");
|
||||||
int constrict = BMO_slot_int_get(op, "constrict");
|
int constrict = BMO_slot_bool_get(op, "constrict");
|
||||||
|
|
||||||
BMO_slot_buffer_flag_enable(bm, op, "geom", SEL_ORIG, BM_ALL);
|
BMO_slot_buffer_flag_enable(bm, op, "geom", SEL_ORIG, BM_ALL);
|
||||||
|
|
||||||
if (constrict)
|
if (constrict)
|
||||||
bmesh_regionextend_constrict(bm, op, usefaces);
|
bmesh_regionextend_constrict(bm, op, use_faces);
|
||||||
else
|
else
|
||||||
bmesh_regionextend_extend(bm, op, usefaces);
|
bmesh_regionextend_extend(bm, op, use_faces);
|
||||||
|
|
||||||
BMO_slot_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL);
|
BMO_slot_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL);
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
|
|||||||
BLI_array_declare(fstack);
|
BLI_array_declare(fstack);
|
||||||
BMLoop *l, *l2;
|
BMLoop *l, *l2;
|
||||||
float maxx, cent[3];
|
float maxx, cent[3];
|
||||||
int i, maxi, flagflip = BMO_slot_int_get(op, "doflip");
|
int i, maxi, flagflip = BMO_slot_bool_get(op, "do_flip");
|
||||||
|
|
||||||
startf = NULL;
|
startf = NULL;
|
||||||
maxx = -1.0e10;
|
maxx = -1.0e10;
|
||||||
@ -381,9 +381,9 @@ void bmesh_vertexsmooth_exec(BMesh *bm, BMOperator *op)
|
|||||||
float *co, *co2, clipdist = BMO_slot_float_get(op, "clipdist");
|
float *co, *co2, clipdist = BMO_slot_float_get(op, "clipdist");
|
||||||
int i, j, clipx, clipy, clipz;
|
int i, j, clipx, clipy, clipz;
|
||||||
|
|
||||||
clipx = BMO_slot_int_get(op, "mirror_clip_x");
|
clipx = BMO_slot_bool_get(op, "mirror_clip_x");
|
||||||
clipy = BMO_slot_int_get(op, "mirror_clip_y");
|
clipy = BMO_slot_bool_get(op, "mirror_clip_y");
|
||||||
clipz = BMO_slot_int_get(op, "mirror_clip_z");
|
clipz = BMO_slot_bool_get(op, "mirror_clip_z");
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) {
|
BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) {
|
||||||
|
@ -701,7 +701,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
|
|||||||
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
|
EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
@ -742,7 +742,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
|
|||||||
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
|
EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
@ -787,7 +787,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
|
|||||||
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
float thresh = CTX_data_tool_settings(C)->select_thresh;
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%d thresh=%f", BM_ELEM_SELECT, type, thresh);
|
EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%i thresh=%f", BM_ELEM_SELECT, type, thresh);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
|
@ -99,7 +99,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
|
|||||||
ts->editbutflag|flag,
|
ts->editbutflag|flag,
|
||||||
cuts, 0, RNA_enum_get(op->ptr, "quadcorner"),
|
cuts, 0, RNA_enum_get(op->ptr, "quadcorner"),
|
||||||
RNA_boolean_get(op->ptr, "quadtri"),
|
RNA_boolean_get(op->ptr, "quadtri"),
|
||||||
1, RNA_int_get(op->ptr, "seed"));
|
TRUE, RNA_int_get(op->ptr, "seed"));
|
||||||
|
|
||||||
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
|
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
|
||||||
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
|
||||||
@ -1215,8 +1215,9 @@ static int editbmesh_edge_split(bContext *C, wmOperator *op)
|
|||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%d",
|
if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%i",
|
||||||
BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts"))) {
|
BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts")))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
BMO_op_exec(bm, &bmop);
|
BMO_op_exec(bm, &bmop);
|
||||||
@ -1380,7 +1381,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op)
|
|||||||
if (!eed)
|
if (!eed)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%d", eed, do_ccw);
|
EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%b", eed, do_ccw);
|
||||||
|
|
||||||
/* avoid adding to the selection if we start off with only a selected edge,
|
/* avoid adding to the selection if we start off with only a selected edge,
|
||||||
* we could also just deselect the single edge easily but use the BMO api
|
* we could also just deselect the single edge easily but use the BMO api
|
||||||
@ -1564,7 +1565,7 @@ static int normals_make_consistent_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* doflip has to do with bmesh_rationalize_normals, it's an internal
|
/* doflip has to do with bmesh_rationalize_normals, it's an internal
|
||||||
* thing */
|
* thing */
|
||||||
if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf doflip=%d", BM_ELEM_SELECT, 1))
|
if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf do_flip=%d", BM_ELEM_SELECT, TRUE))
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
if (RNA_boolean_get(op->ptr, "inside"))
|
if (RNA_boolean_get(op->ptr, "inside"))
|
||||||
@ -1600,7 +1601,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
|
|||||||
Object *obedit = CTX_data_edit_object(C);
|
Object *obedit = CTX_data_edit_object(C);
|
||||||
BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
|
BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
|
||||||
ModifierData *md;
|
ModifierData *md;
|
||||||
int mirrx = 0, mirry = 0, mirrz = 0;
|
int mirrx = FALSE, mirry = FALSE, mirrz = FALSE;
|
||||||
int i, repeat;
|
int i, repeat;
|
||||||
float clipdist = 0.0f;
|
float clipdist = 0.0f;
|
||||||
|
|
||||||
@ -1618,11 +1619,11 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
if (mmd->flag & MOD_MIR_CLIPPING) {
|
if (mmd->flag & MOD_MIR_CLIPPING) {
|
||||||
if (mmd->flag & MOD_MIR_AXIS_X)
|
if (mmd->flag & MOD_MIR_AXIS_X)
|
||||||
mirrx = 1;
|
mirrx = TRUE;
|
||||||
if (mmd->flag & MOD_MIR_AXIS_Y)
|
if (mmd->flag & MOD_MIR_AXIS_Y)
|
||||||
mirry = 1;
|
mirry = TRUE;
|
||||||
if (mmd->flag & MOD_MIR_AXIS_Z)
|
if (mmd->flag & MOD_MIR_AXIS_Z)
|
||||||
mirrz = 1;
|
mirrz = TRUE;
|
||||||
|
|
||||||
clipdist = mmd->tolerance;
|
clipdist = mmd->tolerance;
|
||||||
}
|
}
|
||||||
@ -1635,7 +1636,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
for (i = 0; i < repeat; i++) {
|
for (i = 0; i < repeat; i++) {
|
||||||
if (!EDBM_CallOpf(em, op,
|
if (!EDBM_CallOpf(em, op,
|
||||||
"vertexsmooth verts=%hv mirror_clip_x=%d mirror_clip_y=%d mirror_clip_z=%d clipdist=%f",
|
"vertexsmooth verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f",
|
||||||
BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist))
|
BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist))
|
||||||
{
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
@ -1840,7 +1841,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op)
|
|||||||
int dir = RNA_enum_get(op->ptr, "direction");
|
int dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%d", BM_ELEM_SELECT, dir);
|
EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%i", BM_ELEM_SELECT, dir);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
@ -1893,7 +1894,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op)
|
|||||||
int dir = RNA_enum_get(op->ptr, "direction");
|
int dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%d", BM_ELEM_SELECT, dir);
|
EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%i", BM_ELEM_SELECT, dir);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
@ -2197,8 +2198,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
|
|||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f",
|
EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f", BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist"));
|
||||||
BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist"));
|
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
|
|
||||||
count = BMO_slot_map_count(em->bm, &bmop, "targetmapout");
|
count = BMO_slot_map_count(em->bm, &bmop, "targetmapout");
|
||||||
@ -2276,7 +2276,7 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
/* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */
|
||||||
EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%d", sv->data, ev->data, type);
|
EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->data, ev->data, type);
|
||||||
|
|
||||||
/* execute the operator */
|
/* execute the operator */
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
@ -3162,8 +3162,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
BMO_slot_int_set(&bmop, "flag", B_KNIFE);
|
BMO_slot_int_set(&bmop, "flag", B_KNIFE);
|
||||||
BMO_slot_int_set(&bmop, "quadcornertype", SUBD_STRAIGHT_CUT);
|
BMO_slot_int_set(&bmop, "quadcornertype", SUBD_STRAIGHT_CUT);
|
||||||
BMO_slot_int_set(&bmop, "singleedge", 0);
|
BMO_slot_bool_set(&bmop, "singleedge", FALSE);
|
||||||
BMO_slot_int_set(&bmop, "gridfill", 0);
|
BMO_slot_bool_set(&bmop, "gridfill", FALSE);
|
||||||
|
|
||||||
BMO_slot_float_set(&bmop, "radius", 0);
|
BMO_slot_float_set(&bmop, "radius", 0);
|
||||||
|
|
||||||
@ -3262,7 +3262,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
|
|||||||
EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS);
|
EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS);
|
||||||
|
|
||||||
BM_mesh_normals_update(bmnew);
|
BM_mesh_normals_update(bmnew);
|
||||||
BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%i",
|
BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%b",
|
||||||
basenew->object->data, basenew->object, TRUE);
|
basenew->object->data, basenew->object, TRUE);
|
||||||
|
|
||||||
BM_mesh_free(bmnew);
|
BM_mesh_free(bmnew);
|
||||||
@ -3408,8 +3408,9 @@ static int fill_mesh_exec(bContext *C, wmOperator *op)
|
|||||||
BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
|
BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
|
||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
|
|
||||||
if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT))
|
if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
|
|
||||||
@ -3512,8 +3513,8 @@ static int tris_convert_to_quads_exec(bContext *C, wmOperator *op)
|
|||||||
domaterials = RNA_boolean_get(op->ptr, "materials");
|
domaterials = RNA_boolean_get(op->ptr, "materials");
|
||||||
|
|
||||||
if (!EDBM_CallOpf(em, op,
|
if (!EDBM_CallOpf(em, op,
|
||||||
"join_triangles faces=%hf limit=%f compare_sharp=%i compare_uvs=%i compare_vcols=%i compare_materials=%i",
|
"join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b",
|
||||||
BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
|
BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials))
|
||||||
{
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
@ -3684,8 +3685,9 @@ static int spin_mesh_exec(bContext *C, wmOperator *op)
|
|||||||
mul_m3_v3(imat, axis);
|
mul_m3_v3(imat, axis);
|
||||||
|
|
||||||
if (!EDBM_InitOpf(em, &spinop, op,
|
if (!EDBM_InitOpf(em, &spinop, op,
|
||||||
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=%d",
|
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b",
|
||||||
BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli)) {
|
BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
BMO_op_exec(bm, &spinop);
|
BMO_op_exec(bm, &spinop);
|
||||||
@ -3809,8 +3811,8 @@ static int screw_mesh_exec(bContext *C, wmOperator *op)
|
|||||||
negate_v3(dvec);
|
negate_v3(dvec);
|
||||||
|
|
||||||
if (!EDBM_InitOpf(em, &spinop, op,
|
if (!EDBM_InitOpf(em, &spinop, op,
|
||||||
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=0",
|
"spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b",
|
||||||
BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns))
|
BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns, FALSE))
|
||||||
{
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
@ -4506,8 +4508,8 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op)
|
|||||||
fac = w[recursion - i - 1] * factor;
|
fac = w[recursion - i - 1] * factor;
|
||||||
|
|
||||||
if (!EDBM_InitOpf(em, &bmop, op,
|
if (!EDBM_InitOpf(em, &bmop, op,
|
||||||
"bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%i use_even=%i use_dist=%i",
|
"bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%b use_even=%b use_dist=%b",
|
||||||
BM_ELEM_SELECT, fac, li, 1, use_even, use_dist))
|
BM_ELEM_SELECT, fac, li, TRUE, use_even, use_dist))
|
||||||
{
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,7 @@ int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
|
|||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
|
||||||
if (!BMO_op_vinitf(bm, bmop, fmt, list)) {
|
if (!BMO_op_vinitf(bm, bmop, fmt, list)) {
|
||||||
BKE_report(op->reports, RPT_ERROR,
|
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||||
"Parse error in EDBM_CallOpf");
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -173,8 +172,7 @@ int EDBM_CallOpf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
|
|||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
|
||||||
if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
|
if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
|
||||||
BKE_report(op->reports, RPT_ERROR,
|
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||||
"Parse error in EDBM_CallOpf");
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -198,8 +196,7 @@ int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot
|
|||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
|
||||||
if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
|
if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
|
||||||
BKE_report(op->reports, RPT_ERROR,
|
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||||
"Parse error in EDBM_CallOpf");
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -415,11 +412,11 @@ void EDBM_select_flush(BMEditMesh *em)
|
|||||||
void EDBM_select_more(BMEditMesh *em)
|
void EDBM_select_more(BMEditMesh *em)
|
||||||
{
|
{
|
||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
int usefaces = em->selectmode > SCE_SELECT_EDGE;
|
int use_faces = em->selectmode > SCE_SELECT_EDGE;
|
||||||
|
|
||||||
BMO_op_initf(em->bm, &bmop,
|
BMO_op_initf(em->bm, &bmop,
|
||||||
"regionextend geom=%hvef constrict=%d usefaces=%d",
|
"regionextend geom=%hvef constrict=%i use_faces=%b",
|
||||||
BM_ELEM_SELECT, 0, usefaces);
|
BM_ELEM_SELECT, FALSE, use_faces);
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
|
BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
|
||||||
BMO_op_finish(em->bm, &bmop);
|
BMO_op_finish(em->bm, &bmop);
|
||||||
@ -430,11 +427,11 @@ void EDBM_select_more(BMEditMesh *em)
|
|||||||
void EDBM_select_less(BMEditMesh *em)
|
void EDBM_select_less(BMEditMesh *em)
|
||||||
{
|
{
|
||||||
BMOperator bmop;
|
BMOperator bmop;
|
||||||
int usefaces = em->selectmode > SCE_SELECT_EDGE;
|
int use_faces = em->selectmode > SCE_SELECT_EDGE;
|
||||||
|
|
||||||
BMO_op_initf(em->bm, &bmop,
|
BMO_op_initf(em->bm, &bmop,
|
||||||
"regionextend geom=%hvef constrict=%d usefaces=%d",
|
"regionextend geom=%hvef constrict=%i use_faces=%b",
|
||||||
BM_ELEM_SELECT, 0, usefaces);
|
BM_ELEM_SELECT, FALSE, use_faces);
|
||||||
BMO_op_exec(em->bm, &bmop);
|
BMO_op_exec(em->bm, &bmop);
|
||||||
BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
|
BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL);
|
||||||
BMO_op_finish(em->bm, &bmop);
|
BMO_op_finish(em->bm, &bmop);
|
||||||
@ -525,7 +522,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%i", &um->me, TRUE);
|
BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%b", &um->me, TRUE);
|
||||||
um->selectmode = em->selectmode;
|
um->selectmode = em->selectmode;
|
||||||
|
|
||||||
return um;
|
return um;
|
||||||
@ -538,13 +535,14 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata))
|
|||||||
undomesh *um = umv;
|
undomesh *um = umv;
|
||||||
BMesh *bm;
|
BMesh *bm;
|
||||||
|
|
||||||
|
/* BMESH_TODO - its possible the name wont be found right?, should fallback */
|
||||||
ob = (Object *)find_id("OB", um->obname);
|
ob = (Object *)find_id("OB", um->obname);
|
||||||
ob->shapenr = em->bm->shapenr;
|
ob->shapenr = em->bm->shapenr;
|
||||||
|
|
||||||
BMEdit_Free(em);
|
BMEdit_Free(em);
|
||||||
|
|
||||||
bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
|
bm = BM_mesh_create(ob, bm_mesh_allocsize_default);
|
||||||
BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", &um->me, ob, 0);
|
BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", &um->me, ob, FALSE);
|
||||||
|
|
||||||
em2 = BMEdit_Create(bm, TRUE);
|
em2 = BMEdit_Create(bm, TRUE);
|
||||||
*em = *em2;
|
*em = *em2;
|
||||||
|
@ -145,8 +145,10 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
|
|||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
||||||
"create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat))
|
"create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
|
|
||||||
@ -188,8 +190,9 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
|
|||||||
me = obedit->data;
|
me = obedit->data;
|
||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f))
|
if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f)) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
/* BMESH_TODO make plane side this: M_SQRT2 - plane (diameter of 1.41 makes it unit size) */
|
/* BMESH_TODO make plane side this: M_SQRT2 - plane (diameter of 1.41 makes it unit size) */
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
@ -242,10 +245,12 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
|
|||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
||||||
"create_circle segments=%i diameter=%f cap_ends=%i cap_tris=%i mat=%m4",
|
"create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b mat=%m4",
|
||||||
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
|
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
|
||||||
cap_end, cap_tri, mat))
|
cap_end, cap_tri, mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
|
|
||||||
@ -298,11 +303,17 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
|
|||||||
me = obedit->data;
|
me = obedit->data;
|
||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(
|
||||||
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%i cap_tris=%i depth=%f mat=%m4",
|
em, op, "vertout",
|
||||||
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"),
|
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
|
||||||
RNA_float_get(op->ptr, "radius"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat))
|
RNA_int_get(op->ptr, "vertices"),
|
||||||
|
RNA_float_get(op->ptr, "radius"),
|
||||||
|
RNA_float_get(op->ptr, "radius"),
|
||||||
|
cap_end, cap_tri,
|
||||||
|
RNA_float_get(op->ptr, "depth"), mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
|
|
||||||
@ -357,11 +368,14 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
|
|||||||
me = obedit->data;
|
me = obedit->data;
|
||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(
|
||||||
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%i cap_tris=%i depth=%f mat=%m4",
|
em, op, "vertout",
|
||||||
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1"),
|
"create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4",
|
||||||
RNA_float_get(op->ptr, "radius2"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat))
|
RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1"),
|
||||||
|
RNA_float_get(op->ptr, "radius2"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
|
|
||||||
@ -416,10 +430,10 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
|
|||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
||||||
"create_grid xsegments=%i ysegments=%i size=%f mat=%m4",
|
"create_grid xsegments=%i ysegments=%i size=%f mat=%m4",
|
||||||
RNA_int_get(op->ptr, "x_subdivisions"),
|
RNA_int_get(op->ptr, "x_subdivisions"),
|
||||||
RNA_int_get(op->ptr, "y_subdivisions"),
|
RNA_int_get(op->ptr, "y_subdivisions"),
|
||||||
RNA_float_get(op->ptr, "size") * dia, mat))
|
RNA_float_get(op->ptr, "size") * dia, mat))
|
||||||
{
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
@ -518,10 +532,12 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
|
|||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
||||||
"create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4",
|
"create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4",
|
||||||
RNA_int_get(op->ptr, "ring_count"), RNA_int_get(op->ptr, "segments"),
|
RNA_int_get(op->ptr, "ring_count"), RNA_int_get(op->ptr, "segments"),
|
||||||
RNA_float_get(op->ptr,"size"), mat))
|
RNA_float_get(op->ptr,"size"), mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
make_prim_finish(C, &state, enter_editmode);
|
make_prim_finish(C, &state, enter_editmode);
|
||||||
|
|
||||||
@ -571,10 +587,12 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
|
|||||||
me = obedit->data;
|
me = obedit->data;
|
||||||
em = me->edit_btmesh;
|
em = me->edit_btmesh;
|
||||||
|
|
||||||
if (!EDBM_CallAndSelectOpf(em, op, "vertout",
|
if (!EDBM_CallAndSelectOpf(
|
||||||
"create_icosphere subdivisions=%i diameter=%f mat=%m4",
|
em, op, "vertout",
|
||||||
RNA_int_get(op->ptr, "subdivisions"),
|
"create_icosphere subdivisions=%i diameter=%f mat=%m4",
|
||||||
RNA_float_get(op->ptr, "size"), mat)) {
|
RNA_int_get(op->ptr, "subdivisions"),
|
||||||
|
RNA_float_get(op->ptr, "size"), mat))
|
||||||
|
{
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
|
|||||||
if (lcd->do_cut) {
|
if (lcd->do_cut) {
|
||||||
BM_mesh_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f,
|
BM_mesh_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f,
|
||||||
0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT,
|
0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT,
|
||||||
SUBD_PATH, 0, 0, 0);
|
SUBD_PATH, 0, FALSE, 0);
|
||||||
|
|
||||||
/* force edge slide to edge select mode in in face select mode */
|
/* force edge slide to edge select mode in in face select mode */
|
||||||
if (em->selectmode & SCE_SELECT_FACE) {
|
if (em->selectmode & SCE_SELECT_FACE) {
|
||||||
|
@ -59,12 +59,6 @@ ok: the EDBM module is for editmode bmesh stuff. in contrast, the
|
|||||||
/*calls a bmesh op, reporting errors to the user, etc*/
|
/*calls a bmesh op, reporting errors to the user, etc*/
|
||||||
int EDBM_CallOpf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
|
int EDBM_CallOpf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
|
||||||
|
|
||||||
/*calls a bmesh op, reporting errors to the user, etc.
|
|
||||||
|
|
||||||
selects an output slot specified by selslot*/
|
|
||||||
//int EDBM_CallAndSelectOpf(struct BMEditMesh *em, struct wmOperator *op, char *selslot, char *fmt, ...);
|
|
||||||
//moved to ED_mesh.h
|
|
||||||
|
|
||||||
/*same as above, but doesn't report errors.*/
|
/*same as above, but doesn't report errors.*/
|
||||||
int EDBM_CallOpfSilent(struct BMEditMesh *em, const char *fmt, ...);
|
int EDBM_CallOpfSilent(struct BMEditMesh *em, const char *fmt, ...);
|
||||||
|
|
||||||
|
@ -144,8 +144,8 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BMO_op_callf(bm, "bevel geom=%fe percent=%f use_even=%i use_dist=%i",
|
BMO_op_callf(bm, "bevel geom=%fe percent=%f use_even=%b use_dist=%b",
|
||||||
EDGE_MARK, bmd->value, (bmd->flags & BME_BEVEL_EVEN)!=0, (bmd->flags & BME_BEVEL_DIST) != 0);
|
EDGE_MARK, bmd->value, (bmd->flags & BME_BEVEL_EVEN) != 0, (bmd->flags & BME_BEVEL_DIST) != 0);
|
||||||
BMO_pop(bm);
|
BMO_pop(bm);
|
||||||
|
|
||||||
BLI_assert(em->looptris == NULL);
|
BLI_assert(em->looptris == NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user