That looks about right to me. The only call you could get rid of is the import and you'd just do that wherever your scriptjob lives (userSetup.py) in the header. Aside from that I don't think you can make it look any nicer. Working with Maya menus looks just as ugly though (at least at our studio because they're all written in Mel so we have to do an import and then call the UI class).
On Feb 20, 9:49 am, "pricee...@googlemail.com" <pricee...@gmail.com> wrote: > Long time no post on this board, Was wondering people s approaches to > running scriptJob commands in python, I ve always tried to avoid them > entirely and prefer to use API callbacks as they re easier but certain > jobs I can t accomplish without them. We have custom MMB menus built > on modelEditors which I ve re written. Tricky thing is getting this to > be delivered in the scriptJob. ScriptJob and certain other commands, > infact anything that requires a "script" flag will not go well with a > modular workflow. Buttons etc etc > > Personally I write everything as a class and have the UI independant > from all functionality, but the scriptjobs won t have this. I ve had > to resort to > > scriptjob = mc.scriptJob( > event=('ModelPanelSetFocus','import > gui.popup_menus;gui.popup_menus.build_menu_to_all_panels();') > ) > > VERY ugly. but I can t have it call a class method or atleast I have > nt figured it out. Anyone had similar issues ? > > Tom Price > Blue Zoo animation Studios -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe