I was asked by my group to write some Python plugins for Maya that would be launched through a menu (NOT the shelf editor) as a menuItem. The scripts themselves are done and working fine, but the menu they need to launch from is a MEL UI. The MEL UI is too massive for me to convert into Python on such short notice. Here's what I have within the menu:
menu -label "Export/Import";
menuItem -label "Export Lights" -sourceType \"python\" -c "\"itemPath/item_export\"";
menuItem -label "Import Lights" -sourceType \"python\" -c "\"itemPath/item_import\"";
The files I'm trying to reference are item_export.py and item_import.py. Of course I've already discovered that -sourceType "python" does not work on menuItems (only on shelf buttons) so I'm totally stuck. Am I screwed or is there a way to launch a python script through a MEL menuItem? The python scripts are initialized so if I need to access item_import.main() I can, does that make a difference in this case? Any help in this matter would be greatly appreciated. Thank you!
