概括
本文包含Nuke中注册面板的默认面板 ID 列表,并解释了如何使用这些 ID。
更多信息
Nuke GUI 由多个面板组成,例如节点图和属性面板,这些面板位于不同的窗格中,即 GUI 的不同部分,不同的面板可以停靠在这些窗格中。
在Nuke中创建的所有面板都会被注册,以便可以将其移动到不同的窗格,或者在某些情况下,可以打开同一面板类型的多个版本。
用户还可以注册自定义面板,为Nuke中的元素创建额外的图形用户界面 (GUI)。例如,创建一个常用节点面板以便轻松再次创建,或者创建一个用于访问渲染农场等流程工具的面板,都是很有用的自定义设置。
这些面板通过nuke scripts.registerPanel()命令注册到Nuke中。有关此命令的更多信息,请参阅我们的文档: 自定义面板。
面板 ID
以下是Nuke 16.0v4 中可创建的标准面板的面板 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
Variables.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 的列表:
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
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()函数的更多信息,请参阅以下链接的文档:
我们很遗憾听到
请告诉我们