diff options
author | Ton Roosendaal <ton@blender.org> | 2010-11-12 20:35:51 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-11-12 20:35:51 +0300 |
commit | c1dec420b089e43d1fee5ba361847d7653167937 (patch) | |
tree | e13671688f61cee1b605b52aec065b0924670ec4 /source/blender/editors/screen | |
parent | 17ab7466a7bcd49166679f3cfdb272e1bfaefd3a (diff) |
Bugfix #20382
Fixed old annoyance in Search menu, with a load of object-mode
operators showing up in editmode.
It's much cleaner now, but it will take further work and
investigation to have context & polls work satisfying for all cases.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index d85746d4b3e..4fac0abb50e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -116,6 +116,24 @@ int ED_operator_scene_editable(bContext *C) return 0; } +int ED_operator_objectmode(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + Object *obact= CTX_data_active_object(C); + + if(scene==NULL || scene->id.lib) + return 0; + if( CTX_data_edit_object(C) ) + return 0; + + /* add a check for ob->mode too? */ + if(obact && obact->mode) + return 0; + + return 1; +} + + static int ed_spacetype_test(bContext *C, int type) { if(ED_operator_areaactive(C)) { |