コード例 #1
0
def buildPxrUsdInOpArgsFromDownstreamNode(self,
                                          downstreamNode,
                                          graphState,
                                          portIndex=0):
    if not hasattr(self, '_argsCookTmp'):
        self._argsCookTmp = {}

    key = (FnAttribute.GroupBuilder().set('graphState',
                                          graphState.getOpSystemArgs()).set(
                                              'node',
                                              hash(downstreamNode)).set(
                                                  'portIndex',
                                                  portIndex).build().getHash())

    # Set a dynamic entry that's not prefixed with "var:" so it won't show up
    # in op system args (or other graph state comparisons other than hash
    # uniqueness)
    useGraphState = graphState.edit().setDynamicEntry(
        kArgsCookTmpKeyToken, FnAttribute.StringAttribute(key)).build()

    # trigger a cook with this unique graph state
    Nodes3DAPI.CreateClient(downstreamNode,
                            graphState=useGraphState,
                            portIndex=portIndex)

    if key in self._argsCookTmp:
        result = self._argsCookTmp[key]
        return result
    else:
        # TODO, exception?
        pass
コード例 #2
0
 def getLocationData(self, usdPath):
     client = Nodes3DAPI.CreateClient(NodegraphAPI.GetNode('UsdIn'))
     return client.cookLocation('/root/world/geo%s' % usdPath)