diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-15 09:10:05 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-15 09:10:05 +0300 |
commit | 87c5ed37a5aee2b9d5db3408add9d9254f032b3f (patch) | |
tree | fa04d7dfacc9168982dd7ea91137f8aafd464e52 /source | |
parent | 085795e356c2f8a7701c842735ca4f163ff75058 (diff) |
Tweaked/added poll functions to prevent operators that require
a 3D View from being used outside the 3D View (i.e. the info header
search button)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 1b6b489488c..42ac4b8b6b5 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1486,6 +1486,11 @@ static int pose_select_connected_invoke(bContext *C, wmOperator *op, wmEvent *ev return OPERATOR_FINISHED; } +static int pose_select_linked_poll(bContext *C) +{ + return ( ED_operator_view3d_active(C) && ED_operator_posemode(C) ); +} + void POSE_OT_select_linked(wmOperatorType *ot) { /* identifiers */ @@ -1495,7 +1500,7 @@ void POSE_OT_select_linked(wmOperatorType *ot) /* api callbacks */ ot->exec= NULL; ot->invoke= pose_select_connected_invoke; - ot->poll= ED_operator_posemode; + ot->poll= select_linked_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1580,6 +1585,11 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e return OPERATOR_FINISHED; } +static int armature_select_linked_poll(bContext *C) +{ + return ( ED_operator_view3d_active(C) && ED_operator_editarmature(C) ); +} + void ARMATURE_OT_select_linked(wmOperatorType *ot) { /* identifiers */ diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index dee831b7fd0..ab558afe897 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -2111,7 +2111,7 @@ void MESH_OT_loop_select(wmOperatorType *ot) /* api callbacks */ ot->invoke= mesh_select_loop_invoke; - ot->poll= ED_operator_editmesh; + ot->poll= ED_operator_editmesh_view3d; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2213,7 +2213,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot) /* api callbacks */ ot->invoke= mesh_shortest_path_select_invoke; - ot->poll= ED_operator_editmesh; + ot->poll= ED_operator_editmesh_view3d; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2521,7 +2521,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot) /* api callbacks */ ot->invoke= select_linked_pick_invoke; - ot->poll= ED_operator_editmesh; + ot->poll= ED_operator_editmesh_view3d; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |