i want to create a little command here that constructs a new window containing a modelEditor with my camera..
CODE
window = cmds.window('Facial Gui',toolbox=True)
form = cmds.formLayout()
editor = cmds.modelEditor(camera=self.guiCamera,grid=False,headsUpDisplay=False)
cmds.formLayout( form, edit=True, attachForm=[(editor, 'top', 0), (editor, 'bottom', 0), (editor, 'right', 0), (editor, 'left', 0)])
cmds.showWindow(window)
... and everything works fine, except that shortcuts don't. no switching between move, rotate, scale with w/e/r, no keying with s/shift+w/e/r etc.
instead of creating window+modelEditor, i tried modelPanel, which did support shortcuts, but that started creating panels each time it was called (creating lots of garbage in "panels->panel" menu). i tried this workaround but then maya started crashing:]
CODE
FACIAL_GUI_PANEL_NAME = 'facial_gui_panel'
if cmds.panel(FACIAL_GUI_PANEL_NAME,q=True,exists=True):
cmds.deleteUI(FACIAL_GUI_PANEL_NAME,panel=True)
panel = cmds.modelPanel(FACIAL_GUI_PANEL_NAME,camera=self.guiCamera, isUnique=True, menuBarVisible=False,label='Facial GUI')
editor = cmds.modelPanel(panel,q=True,modelEditor=True)
cmds.modelEditor(editor,e=True,grid=False,headsUpDisplay=False)
I guess I'd like the first approach better, just gotta find out how can i pass keypresses to default hotkey manager of some sort... help?:]