Friday, March 8, 2013

Create Windows


import maya.cmds as cmds;
win = cmds.window(
     'ar_optionsWindow',
     title='Meng\'s First Window', //a title bar string,\is the escape character(转义字符)
     widthHeight=(546,350) //window's size
);
cmds.showWindow(win); //to display the window

PS: You cannot change the window's name when the window is still there. To make changes to a GUI, you must destroy it, make your change, and then show it again. You can destroy your window by pressing the close button in its corner or using the deleteUI command, like the following codes:


cmds.deleteUI(win, window=True); //delete exiting window
win = cmds.window(
    'ar_optionsWindow',
    title='Meng\'s Second Window',
    widthHeight=(546,350)
);
cmds.showWindow(win);


No comments:

Post a Comment