2.5 editmode:

* Added a poll to the editmode operator that checks first that the object is an editable type (no more tabkey on camera, bug reported by DingTo)
This commit is contained in:
Nicholas Bishop
2009-08-17 17:26:58 +00:00
parent f3caa80a49
commit b0508659f6

View File

@@ -3859,6 +3859,16 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
static int editmode_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE ||
ob->type == OB_FONT || ob->type == OB_MBALL ||
ob->type == OB_LATTICE || ob->type == OB_SURF ||
ob->type == OB_CURVE);
}
void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
{
@@ -3870,7 +3880,7 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
/* api callbacks */
ot->exec= editmode_toggle_exec;
ot->poll= ED_operator_object_active;
ot->poll= editmode_toggle_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;