From e838af4d57ea1f0eef4fd62bfb0a8d6e320c72e0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 14 Sep 2009 11:12:44 +0000 Subject: [PATCH] Bugfix #19337: Crash when tweaking knife operator Knife operator now doesn't crash, but repeat operator for this won't work now since the appropriate 3D-View context info is not set when the mouse is in the Tools region (i.e. when using repeat operator in the tools panels). --- source/blender/editors/mesh/editmesh_loop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index c98b387d28a..28103828dd4 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -60,6 +60,7 @@ editmesh_loop: tools with own drawing subloops, select, knife, subdiv #include "BKE_library.h" #include "BKE_mesh.h" #include "BKE_object.h" +#include "BKE_report.h" #include "BKE_utildefines.h" #include "PIL_time.h" @@ -637,6 +638,10 @@ static int knife_cut_exec(bContext *C, wmOperator *op) int len=0; short numcuts=1, mode= RNA_int_get(op->ptr, "type"); + /* edit-object needed for matrix, and ar->regiondata for projections to work */ + if (ELEM3(NULL, obedit, ar, ar->regiondata)) + return OPERATOR_CANCELLED; + if (EM_nvertices_selected(em) < 2) { error("No edges are selected to operate on"); BKE_mesh_end_editmesh(obedit->data, em);