[英]Adding plain text to a Nuke simple panel window
I work with Nuke all the time and I know simple Python to create simple tools in it.我一直在使用 Nuke,我知道简单的 Python 可以在其中创建简单的工具。 I've been able to carry out moderately complicated actions with panels and tools but I am stuck with something that should be very simple, but I can't seem to find the answer here or in nukepedia or in the foundry help and tutorials.我已经能够使用面板和工具执行中等复杂的操作,但我被一些应该非常简单的东西所困扰,但我似乎无法在这里或在 nukepedia 或代工厂帮助和教程中找到答案。 I want to add some simple text to my panel.我想在我的面板中添加一些简单的文本。 For example:例如:
p = nuke.Panel('test')
p.message('This is where I hope to display an explanation of the tool')
p.addButton('Quit')
Where I use p.message
just as a placeholder for what I need.我在哪里使用p.message
作为我需要的占位符。
Any help would be appreciated, I feel like this is so simple that it isn't included in most of the documentation.任何帮助将不胜感激,我觉得这很简单,以至于大多数文档中都没有包含它。
For windows bringing a simple message use this code:对于 windows 带来简单消息,请使用以下代码:
nuke.message('Explanation of the Tool')
If you need user's yes
/ no
choice, use this code:如果您需要用户的yes
/ no
选择,请使用以下代码:
if nuke.ask('Do you like to create ColorWheel node?'):
nuke.createNode('ColorWheel')
In case you need a panel, use the following code:如果您需要面板,请使用以下代码:
panel = nuke.Panel('Test panel')
panel.addNotepad('Explanation Here','Explanation of the Tool')
panel.addButton('Quit')
..and then: ..接着:
panel.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.