向Nuke简单面板窗口添加纯文本

问题描述 投票:1回答:1

我一直与Nuke一起工作,而且我知道简单的Python可以在其中创建简单的工具。我已经能够使用面板和工具执行一些复杂的操作,但是我坚持应该是非常简单的操作,但似乎无法在这里,nukepedia或铸造帮助和教程中找到答案。我想在面板中添加一些简单的文本。例如:

p = nuke.Panel('test')
p.message('This is where I hope to display an explanation of the tool')
p.addButton('Quit')

我将p.message用作占位符的位置。

任何帮助,我都会感觉很简单,因此大多数文档中都没有。

python text panel nuke
1个回答
0
投票

对于带简单消息的Windows,请使用此代码:

nuke.message('Explanation of the Tool')

如果需要用户的yes / no选择,请使用此代码:

if nuke.ask('Do you like to create ColorWheel node?'):
    nuke.createNode('ColorWheel')

如果需要面板,请使用以下代码:

panel = nuke.Panel('Test panel')
panel.addNotepad('Explanation Here','Explanation of the Tool')
panel.addButton('Quit')

..然后:

panel.show()
© www.soinside.com 2019 - 2024. All rights reserved.