2016-12-17 59 views
1

有没有办法在Text节点中的文本的整个message上强制缩放。我看到Nuke 9.0v7或10有一种方法,但这不适用于我。Nuke 9中的Python

我甚至试图强制迂回的方式来加强字体,但仍然无法弄清楚这一点。

nuke.toNode("shot_" + str(c+1) + "_text")['message'].setValue("") 
nuke.toNode("shot_" + str(c+1) + "_text")['font_size'].setValue(33) 
nuke.toNode("shot_" + str(c+1) + "_text") ['baseline_shift'].setValue(-13) 
nuke.toNode("shot_" + str(c+1) + "_text")['message'].setValue((ntpath.basename(thumbnailShots[c+ contactSheetUp])[:-4])[:17]) 

非常类似于这个博客的评论。 (字体以原生100字体大小显示,字体大小为33)。

http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=113652

回答

0

它肯定在NUKE 10.5作品。使用此语法更改font_size值:

p = nuke.nodes.Text2(name="myNode") 
p['box'].setValue([0,0,2000,1500]) 
p['xjustify'].setValue("center") 
p['yjustify'].setValue("center") 
p['message'].setValue("NUKE [version]") 
p['font_size'].setValue(175) 
nuke.connectViewer(0, p) 

如果你想改变一个global_font_scale值,你应该使用这种方法:

nuke.toNode('myNode')['global_font_scale'].setValue(5)