Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco De La Cruz <dlcs.frank@gmail.com>2012-04-15 22:34:13 +0400
committerFrancisco De La Cruz <dlcs.frank@gmail.com>2012-04-15 22:34:13 +0400
commit86508076d8190a374bcd9c17785eb0802dd4c1ca (patch)
treef3f47c0b0cf5f528b6af34a3aadacdafcd3a0d0b /source/blender/bmesh
parent117f2826b929b0100b4233577a310ae5cc907cb0 (diff)
Fix [#30943] Crash when edge mode enabled and use the bmesh vertex slide(shift-V)
Also fixed snapping sensitivity. Gave BMOp a more consistent name "vertex_slide".
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c8
-rw-r--r--source/blender/bmesh/intern/bmesh_operators_private.h2
-rw-r--r--source/blender/bmesh/operators/bmo_slide.c17
3 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 3352df71414..5896a18223a 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1110,14 +1110,14 @@ static BMOpDefine bmo_inset_def = {
*
* Translates vertes along an edge
*/
-static BMOpDefine bmo_vert_slide_def = {
-"vertslide",
+static BMOpDefine bmo_vertex_slide_def = {
+ "vertex_slide",
{{BMO_OP_SLOT_ELEMENT_BUF, "vert"},
{BMO_OP_SLOT_ELEMENT_BUF, "edge"},
{BMO_OP_SLOT_ELEMENT_BUF, "vertout"},
{BMO_OP_SLOT_FLT, "distance_t"},
{0} /* null-terminating sentinel */},
- bmo_vert_slide_exec,
+ bmo_vertex_slide_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
};
@@ -1189,7 +1189,7 @@ BMOpDefine *opdefines[] = {
&bmo_bridge_loops_def,
&bmo_solidify_def,
&bmo_inset_def,
- &bmo_vert_slide_def,
+ &bmo_vertex_slide_def,
};
int bmesh_total_ops = (sizeof(opdefines) / sizeof(void *));
diff --git a/source/blender/bmesh/intern/bmesh_operators_private.h b/source/blender/bmesh/intern/bmesh_operators_private.h
index c4b4f01b5b5..62cabe88b05 100644
--- a/source/blender/bmesh/intern/bmesh_operators_private.h
+++ b/source/blender/bmesh/intern/bmesh_operators_private.h
@@ -43,7 +43,7 @@ void bmo_dissolve_faces_exec(BMesh *bmesh, BMOperator *op);
void bmo_dissolve_verts_exec(BMesh *bmesh, BMOperator *op);
void bmo_dissolve_limit_exec(BMesh *bmesh, BMOperator *op);
void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op);
-void bmo_vert_slide_exec(BMesh *bm, BMOperator *op);
+void bmo_vertex_slide_exec(BMesh *bm, BMOperator *op);
void bmo_connectverts_exec(BMesh *bm, BMOperator *op);
void bmo_extrude_vert_indiv_exec(BMesh *bm, BMOperator *op);
void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op);
diff --git a/source/blender/bmesh/operators/bmo_slide.c b/source/blender/bmesh/operators/bmo_slide.c
index 9414c7308b6..7b7b0638a3f 100644
--- a/source/blender/bmesh/operators/bmo_slide.c
+++ b/source/blender/bmesh/operators/bmo_slide.c
@@ -40,7 +40,7 @@
* Slides a vertex along a connected edge
*
*/
-void bmo_vert_slide_exec(BMesh *bm, BMOperator *op)
+void bmo_vertex_slide_exec(BMesh *bm, BMOperator *op)
{
BMOIter oiter;
BMIter iter;
@@ -60,8 +60,10 @@ void bmo_vert_slide_exec(BMesh *bm, BMOperator *op)
if (!vertex) {
- if (G.debug & G_DEBUG)
- fprintf(stderr, "vertslide: No vertex selected...");
+ if (G.debug & G_DEBUG) {
+ fprintf(stderr, "vertex_slide: No vertex selected...");
+ }
+ BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide Error: Invalid selection.");
return;
}
@@ -78,8 +80,10 @@ void bmo_vert_slide_exec(BMesh *bm, BMOperator *op)
/* Only allow sliding if an edge is selected */
if (selected_edges == 0) {
- if (G.debug & G_DEBUG)
- fprintf(stderr, "vertslide: select a single edge\n");
+ if (G.debug & G_DEBUG) {
+ fprintf(stderr, "vertex_slide: select a single edge\n");
+ }
+ BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide Error: Invalid selection.");
return;
}
@@ -102,9 +106,6 @@ void bmo_vert_slide_exec(BMesh *bm, BMOperator *op)
interp_v3_v3v3(vertex->co, vertex->co, other->co, distance_t);
}
- /* Deselect the edges */
- BMO_slot_buffer_hflag_disable(bm, op, "edge", BM_ALL, BM_ELEM_SELECT, TRUE);
-
/* Return the new edge. The same previously marked with VERT_MARK */
BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
return;