def channelbox_command_keyAll(box, menuItem, key, *args): with sysCmd.Undo(): cmds.channelBox(box.channelbox, e=1, exe=("if( `getAttr -k \"#P.#A\"` ) setKeyframe \"#P.#A\";", 0))