渲染依赖

功能GetSortedDependencyList()提供获取Render节点所依赖的任何其他节点的名称所需的信息。例如,以下脚本按顺序返回“渲染”节点的依存关系的名称:

def dependencyList(nodeName): """ Use GetSortedDependencyList to retrieve the entire dependency tree for a render node. Each entry is ordered so that render nodes are sorted by number of dependencies, in descending order. """ # Get hold of the node and all of its dependencies as a sequence of dictionaries node = NodegraphAPI.GetNode(nodeName) info = FarmAPI.GetSortedDependencyList( [ node ] ) # Extract the 'deps' for each entry in the sequence # to produce a flat list. allDeps = [ dep for i in info for dep in i["deps"] ] return allDeps