static int make_regular_poll(bContext *C) { Object *ob; if (ED_operator_editlattice(C)) return 1; ob = CTX_data_active_object(C); return (ob && ob->type == OB_LATTICE); }
// TODO: check for properties window modifier context too as alternative? static int hook_op_edit_poll(bContext *C) { Object *obedit= CTX_data_edit_object(C); if (obedit) { if (ED_operator_editmesh(C)) return 1; if (ED_operator_editsurfcurve(C)) return 1; if (ED_operator_editlattice(C)) return 1; //if (ED_operator_editmball(C)) return 1; } return 0; }