'Triggered when a node\'s output values have changed. (NOT called during process())
Propagates new data forward through network.'

def nodeOutputChanged(self, startNode):

    if self.processing:
        return
    self.processing = True
    try:
        deps = {}
        for (name, node) in self._nodes.items():
            deps[node] = []
            for t in node.outputs().values():
                deps[node].extend(t.dependentNodes())
        order = fn.toposort(deps, nodes=[startNode])
        order.reverse()
        terms = set(startNode.outputs().values())
        for node in order[1:]:
            update = False
            for term in list(node.inputs().values()):
                deps = list(term.connections().keys())
                for d in deps:
                    if (d in terms):
                        update |= True
                        term.inputChanged(d, process=False)
            if update:
                node.update()
                terms |= set(node.outputs().values())
    finally:
        self.processing = False
        if self.inputWasSet:
            self.inputWasSet = False
        else:
            self.sigStateChanged.emit()
