我正在尝试设置非主Maya窗口(hypergraph等)的宽度。在
但命令实际上并没有移动它。它返回的结果是…这真的很奇怪。有人知道怎么回事吗?在
openWindows = cmds.lsUI(windows=True)
for i, window in enumerate(openWindows):
if window != "MayaWindow":
widthQueryPre = cmds.windowPref(window, q=True, w=True)
cmds.windowPref(window, e=True, w=200) # Why doesn't this change the window's width?
widthQueryPost = cmds.windowPref(window, q=True, w=True)
print i, window, widthQueryPre, widthQueryPost
根据Maya 2014 documentation(我使用的版本):
这意味着使用
windowPref
命令更改的值不是窗口的实际大小,而是默认大小。但是,关闭子窗口时也会调用此命令。并将覆盖您以前对windowPref
的调用。 关闭子窗口后,必须调用windowPref
。下一次打开子窗口时,它的宽度将是200px。在总而言之:这个命令不会调整当前子窗口的大小,但会设置其默认大小。在
如果要调整当前窗口的大小,请使用
window
命令。在相关问题 更多 >
编程相关推荐