2.5 editmode:
authorNicholas Bishop <nicholasbishop@gmail.com>
Mon, 17 Aug 2009 17:26:58 +0000 (17:26 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Mon, 17 Aug 2009 17:26:58 +0000 (17:26 +0000)
* 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)

source/blender/editors/object/object_edit.c

index d4f2493be2bbf9673b5b0139227e04835aa25d96..f8d969d2462a504d5f6f0c8f085c3b709a30ad47 100644 (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;