レンダリングの依存関係

関数GetSortedDependencyList() Renderノードが依存する他のノードの名前を取得するために必要な情報を提供します。たとえば、次のスクリプトは、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