【问题标题】:Adding plain text to a Nuke simple panel window将纯文本添加到 Nuke 简单面板窗口
【发布时间】:2019-10-04 20:28:07
【问题描述】:

我一直在使用 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】:

对于带有简单消息的窗口,请使用以下代码:

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()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多