def toggle_burnin(value):
'''Toggle default viewport burnin'''
viewport_burnin = get_viewport_burnin()
if viewport_burnin:
cmds.setAttr(viewport_burnin + '.v', value)
return
if not value:
return
if not cmds.pluginInfo(burnin.type_name, q=True, loaded=True):
cmds.loadPlugin(burnin.type_name)
viewport_burnin = cmds.createNode('burnin')
cmds.addAttr(viewport_burnin, ln='viewport_burnin', at='bool', dv=True)
cmds.setAttr(viewport_burnin + '.fontSize', 16)
cmds.setAttr(viewport_burnin + '.fontWeight', 75)
cmds.setAttr(viewport_burnin + '.fontAlpha', 0.75)
t0 = viewport_burnin + '.textArray[0]'
cmds.setAttr(t0 + '.textString', '{frame:0>3d}\n{camera}', type='string')
cmds.setAttr(t0 + '.textColor', 1, 1, 1)
cmds.setAttr(t0 + '.textAlign', 7)
t1 = viewport_burnin + '.textArray[1]'
cmds.setAttr(t1 + '.textString', '{user}\n{scene}', type='string')
cmds.setAttr(t1 + '.textColor', 1, 1, 1)
cmds.setAttr(t1 + '.textAlign', 6)
评论列表
文章目录