def _resolveLinkedAxis(axis):
    """Follow a chain of axis function dependencies."""
    loopcheck = set()
    while axis is not None and axis.isLinked():
        loopcheck.add(axis)
        axis = axis.getLinkedAxis()
        if axis in loopcheck:
            # fail if loop
            return None
    return axis