diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-21 18:10:09 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-21 18:10:09 +0300 |
commit | fae8dc5a735d6e47d96d5757fbc51a33b45a4cea (patch) | |
tree | fcced0ae10dba2d9afbcc6ef4c997edb6d762d8f /source/blender/editors/mesh/loopcut.c | |
parent | b0f87a17460578382cabb8447934cb045eee223a (diff) |
Error/Warning report flipping.
An operator Error throws up a menu, a Warning only a flashy header print.
In mesh editmode the menus for simple failures got very annoying, like
"Already a face" for Fkey on a face.
Proposal is to use warning for contextual failures, like:
- wrong selection
- unsupported combination
- wrong modes
And use errors for cases you really need user attention, for example when
issues are invisble or potentially damaging work.
- Memory failures
- Files not found
List can grow in future :) let's test this for mesh now.
I'll tackle this for other ops later after review.
(Also changed: loopcut disabled when editmode shows deformed result)
Diffstat (limited to 'source/blender/editors/mesh/loopcut.c')
-rw-r--r-- | source/blender/editors/mesh/loopcut.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index f39180bbe1b..bc42bd2747b 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -32,11 +32,11 @@ #include <stdio.h> #include "DNA_ID.h" +#include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" -#include "DNA_object_types.h" #include "MEM_guardedalloc.h" @@ -50,8 +50,10 @@ #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_depsgraph.h" -#include "BKE_scene.h" #include "BKE_mesh.h" +#include "BKE_modifier.h" +#include "BKE_report.h" +#include "BKE_scene.h" #include "BIF_gl.h" #include "BIF_glutil.h" /* for paint cursor */ @@ -385,6 +387,12 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt) EditEdge *edge; int dist = 75; + + if(modifiers_getCageIndex(CTX_data_scene(C), CTX_data_edit_object(C), NULL, 1)>=0) { + BKE_report(op->reports, RPT_WARNING, "Loop cut can't work on deformed edit mesh display"); + return OPERATOR_CANCELLED; + } + view3d_operator_needs_opengl(C); if (!ringsel_init(C, op, 1)) |