Fix 37571: Knife Select should be disabled when no faces are selected
also check a similar case for bisect
This commit is contained in:
Submodule release/scripts/addons updated: 870b946120...6501c6cadf
Submodule release/scripts/addons_contrib updated: 4fe6a9e046...6695fc64a5
@@ -36,6 +36,7 @@
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_editmesh.h"
|
||||
#include "BKE_report.h"
|
||||
|
||||
#include "RNA_define.h"
|
||||
#include "RNA_access.h"
|
||||
@@ -110,8 +111,15 @@ static bool mesh_bisect_interactive_calc(
|
||||
|
||||
static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
int ret;
|
||||
|
||||
if (em->bm->totedgesel == 0) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Selected edges/faces required");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* if the properties are set or there is no rv3d,
|
||||
* skip model and exec immediately */
|
||||
|
||||
@@ -129,8 +137,6 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
wmGesture *gesture = op->customdata;
|
||||
BisectData *opdata;
|
||||
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
|
||||
opdata = MEM_mallocN(sizeof(BisectData), "inset_operator_data");
|
||||
opdata->mesh_backup = EDBM_redo_state_store(em);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_editmesh.h"
|
||||
#include "BKE_editmesh_bvh.h"
|
||||
#include "BKE_report.h"
|
||||
|
||||
#include "BIF_gl.h"
|
||||
#include "BIF_glutil.h" /* for paint cursor */
|
||||
@@ -2646,6 +2647,15 @@ static int knifetool_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
||||
KnifeTool_OpData *kcd;
|
||||
|
||||
if (only_select) {
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
if (em->bm->totfacesel == 0) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Selected faces required");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
/* alloc new customdata */
|
||||
|
||||
Reference in New Issue
Block a user