gpt4 book ai didi

python - nuke.File_Knob() 类未在其他节点中设置文件名

转载 作者:太空宇宙 更新时间:2023-11-03 14:17:46 30 4
gpt4 key购买 nike

我正在使用脚本编辑器将多个 Nuke 节点分组在一起。我想减少使用旋钮界面的输入数量。其中之一是选择图像文件。所以我正在使用

ux_File = nuke.File_Knob("my_file", "Filename")

然后我想使用该文件名并使用以下命令将其设置为 DeepRead Nuke 节点

nDeepRead = nuke.nodes.DeepRead(file = "parent.my_file")

因此,只要文件名发生更改(在旋钮界面中),它就会更新 DeepRead 节点(隐藏在组中)。我怎样才能做到这一点?

最佳答案

如果我正确理解你的问题,答案如下:

fileKnobPath = '/Users/swift/Desktop/file.exr'
nuke.nodes.DeepRead(file=fileKnobPath)

deepRead = nuke.nodes.DeepRead(file="[value DeepRead1.file]")

最后一个命令使用文件旋钮中的表达式创建新的深层节点。

enter image description here

要强制重新加载,请使用此方法(如果文件名已更改):

nodes = nuke.allNodes()

for node in nodes:
if node.Class() == "DeepRead":
node.knob("reload").execute()

关于python - nuke.File_Knob() 类未在其他节点中设置文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48145812/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com