def check_enable(texture):
    """
    By Simon Lundberg and Adam O'Hern for Mechanical Color

    iterates through shader tree parents of item "texture"
    returns True if all shader tree parents are enabled; otherwise False
    uses recursion to work its way through hierarchy
    """

    if not texture.channel('enable'):
        return False
    if texture.parent.type == "polyRender":
        return True
    if texture.parent.type == "scene":
        return False

    return check_enable(texture.parent)