1

我正在使用 Foundry Nuke,我遇到了这个问题:

问题

这是我的程序:

def testing(*args):
    for a in nuke.allNodes('Read'):

        if 'lighting' in a ['name'].value():                        
            readlgt = a


        if 'GI' in a['name'].value():
    #        global readGI
            readGI = a

            mergelgt = nuke.nodes.Merge2(operation='plus')      
            mergelgt.connectInput(0, readlgt)
            mergelgt.connectInput(1, readGI)

testing()
4

1 回答 1

0

尝试这个:

import nuke

readlgt = nuke.nodes.Read(file="~/Desktop/file1.##.exr", name="readlgt")
readGI = nuke.nodes.Read(file="~/Desktop/file2.##.exr", name="readGI")

def testing():
    for a in nuke.allNodes('Read'):
        if 'lighting' in a['name'].value():                        
            a = readlgt

        if 'GI' in a['name'].value():
            a = readGI

            mergelgt = nuke.nodes.Merge2(operation='plus')

            for these in nuke.allNodes():
                these.setSelected(True)     

                mergelgt.setInput(0, readlgt)
                mergelgt.setInput(1, readGI)

testing()
于 2017-07-21T00:37:38.330 回答