【发布时间】:2017-06-21 14:40:11
【问题描述】:
我需要放大 Maya 的 UI,如 here 所示,因为字母和字体太小了。然而,问题是这个解决方案是基于 2016 版本的,这个设置可能已经针对最新版本进行了更改。 如何对 v.2017 做同样的事情?
【问题讨论】:
标签: user-interface zooming maya
我需要放大 Maya 的 UI,如 here 所示,因为字母和字体太小了。然而,问题是这个解决方案是基于 2016 版本的,这个设置可能已经针对最新版本进行了更改。 如何对 v.2017 做同样的事情?
【问题讨论】:
标签: user-interface zooming maya
字体可以通过修改脚本到应用程序包中来放大。
如果您使用的是 Mac,请转到
/Applications/Autodesk/maya20xx/Maya.app/Contents/Resources
如果您使用的是 Windows,请转到
C:\Program Files\Autodesk\Maya20xx\resources\MayaStrings
(其中 xx 是您的 Maya 副本的版本)
您需要先备份并使用编辑器编辑 MayaStrings,然后去搜索和查找
// String set: s_TschemeResources
现在您所要做的就是相应地更改您的操作系统(mac 或 win)的字体大小的第一个数字。即:
s_TschemeResources.rBoldLabelFont_mac = "13,1,0,0,0,0,Lucida Grande" s_TschemeResources.rBoldLabelFont_win = "13,1,0,0,0,0,Tahoma"
【讨论】:
不是全局 UI 答案,但如果您想更改特定 UI 元素的字体,您可以通过将 styleSheet 应用于特定元素来实现...例如,这就是我用来设置脚本的方法编辑器字体首选项。
from PySide2 import QtWidgets
def set_script_editor_font(family = 'Courier New',
emphasis = 'normal',
bg_color = 'normal',
size = 12):
"""
Usage: family: The font's family, ex: Courier, Wingdings, etc...
emphasis: The font's emphasis, ex: Bold, italic, etc... normal (default)
bg_color: The font's background color, ex: black, white, etc... normal (default)
size : The font's size in pixels.
"""
# find the MayaWindow widget
app = QtWidgets.QApplication.instance()
win = next(x for x in app.topLevelWidgets() if x.objectName()=='MayaWindow')
# add a scriptEditor styleSheet to maya_ui
win.setProperty('maya_ui', 'scriptEditor')
styleSheet = '''
QWidget[maya_ui="scriptEditor"] QTextEdit {
font-family: "%s";
font: %s %spx;
background-color: %s;
}
''' %(family, emphasis, size, bg_color)
app.setStyleSheet(styleSheet)
# this is my current favorite
set_script_editor_font(family='Consolas', size=18)
# use this if you code with a quill
set_script_editor_font(family='Lucida Handwriting')
# use this if you're drunk
set_script_editor_font(family='Wingdings')
【讨论】: