Q100484:在 Nuke 中查找并添加面板 ID

关注

概括

本文包含在Nuke中注册的面板的默认面板 ID 列表,并解释了如何使用这些面板。


更多信息

Nuke GUI 由面板组成,例如“节点图”和“属性”面板,它们位于不同的窗格中,GUI 的各个部分可以停靠不同的面板。

Nuke中创建的所有面板都经过注册,以便可以将它们移动到不同的窗格,或者在某些情况下,可以打开同一面板类型的多个版本。

还可以注册自定义面板来创建额外的 GUI,用于控制Nuke内的元素。例如,拥有一个经常创建的节点面板,以便可以轻松地再次创建它们,或者一个用于访问渲染场等管道工具的面板,是一个有用的自定义设置。

这些面板通过使用nuke scripts.registerPanel()命令注册到Nuke中。有关此命令的更多信息可以在我们的文档中找到: 自定义面板


面板识别系统

以下是可在Nuke 14.0v5 中创建的标准面板的面板 ID 列表:

 uk.co.thefoundry.backgroundrenderview.1
Curve Editor.1
DopeSheet.1
Error Console.1
uk.co.thefoundry.monitorController.1

Pixel Analyzer.1
Profile.1
Progress.1
Properties.1
Scenegraph.1
Toolbar.1

-------------------------------------------------- -------------------------------------------------- ----------

 DAG.1
DAG.2
uk.co.thefoundry.histogram.1
uk.co.thefoundry.histogram.2
uk.co.thefoundry.scripteditor.1
uk.co.thefoundry.scripteditor.2
uk.co.thefoundry.vectorscope.1
uk.co.thefoundry.vectorscope.2
Viewer.1
Viewer.2
uk.co.thefoundry.waveformscope.1
uk.co.thefoundry.waveformscope.2

注意:上面的第一部分只能创建一个面板实例,而第二部分可以有同一面板的多个实例。同一面板的每个实例都有不同的编号。

面板 ID 用途

使用面板 ID 的一种方法是在向Nuke GUI 添加额外面板时进行更好的控制。可以使用面板 ID 和命令nuke .getPaneFor()nuke .addToPane()将自定义面板添加到与所需面板相同的窗格中。

下面是如何将简单的 Python 面板添加到与节点图相同的窗格的示例:

class TestPanel(nukescripts.PythonPanel): ### Create a PythonPanel with an enumeration knob
def __init__(self):
nuke scripts.PythonPanel.__init__(self, 'Test Elements')
self.typeKnob = nuke .Enumeration_Knob('element1', 'element1', ['Test1', 'Test2'])
self.addKnob(self.typeKnob)

pane = nuke .getPaneFor('DAG.1') ### Get the pane for the Node Graph, using it’s ID, ‘DAG.1’
p = TestPanel()
p.addToPane(pane)

如果您想从当前Nuke会话中获取打开面板的 ID,包括自定义面板的 ID,可以在脚本编辑器中运行以下代码,并将返回面板标题及其 ID 的列表:

from PySide2 import QtCore, QtGui, QtWidgets

def findPanelIDs():
stack = QtWidgets.QApplication.topLevelWidgets()
while stack:
widget = stack.pop()
if widget.windowTitle():
print ("\nTitle: " + widget.windowTitle())
print ("Panel ID: " + widget.objectName())

stack.extend(c for c in widget.children() if c.isWidgetType())

findPanelIDs()



延伸阅读

有关nuke .getPaneFor()nuke .addToPane()函数的更多信息可以在下面链接的文档中找到:

nuke .getPaneFor()
PythonPanel().addToPane()

    我们很遗憾听到

    请告诉我们