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)
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user