@publisher(LOOK_DEV_TYPES)
def check_multiple_connections_for_textures():
    # load necessary plugins
    plugins = ['matrixNodes', 'quatNodes']
    for plugin in plugins:
        if not pm.pluginInfo(plugin, q=1, l=1):
            pm.loadPlugin(plugin)

    v = staging.get('version')

    # skip if
    skip_types = ['character', 'animation', 'previs']
    for t in v.naming_parents:
        for st in skip_types:
            if t.type and t.type.name.lower().startswith(st):
                return

    # get all the texture nodes
    from anima.env.mayaEnv import repr_tools
    reload(repr_tools)

    # try to find the material it is been used by walking up the connections
    nodes_with_multiple_materials = []

    # by type
    nodes_to_ignore = pm.ls(
        type=[
            'hyperLayout', 'shadingEngine', 'materialInfo', 'time',
            'unitConversion', 'hyperView'
        ]
    )

    # by name
    nodes_to_ignore += pm.ls('lambert1')
    nodes_to_ignore += pm.ls('defaultShaderList*')
    nodes_to_ignore += pm.ls('defaultTextureList*')
    nodes_to_ignore += pm.ls('defaultRenderUtilityList*')

    all_nodes = pm.ls(type=repr_tools.RENDER_RELATED_NODE_TYPES)
    for node in nodes_to_ignore:
        if node in all_nodes:
            all_nodes.remove(node)

    for node in all_nodes:
        materials_connected_to_this_node = \
            pm.ls(node.listHistory(future=True), mat=True)

        # remove self from all_nodes
        if node in materials_connected_to_this_node:
            materials_connected_to_this_node.remove(node)

        if len(materials_connected_to_this_node) > 1:
            nodes_with_multiple_materials.append(node)
        else:
            connections_out_of_this_node = node.outputs()

            [connections_out_of_this_node.remove(h)
             for h in nodes_to_ignore
             if h in connections_out_of_this_node]

            if len(set(connections_out_of_this_node)) > 1:
                nodes_with_multiple_materials.append(node)

    # if we find more than one material add it to the list
    # raise a PublishError if we have an item in the list
    if len(nodes_with_multiple_materials) > 0:
        pm.select(nodes_with_multiple_materials)
        raise PublishError(
            'Please update the scene so the following nodes are connected <br>'
            'to only <b>one material</b> (duplicate them):<br><br>%s<br><br>' %
            '<br>'.join(map(lambda x: x.name(), nodes_with_multiple_materials))
        )
Returns True if the argument is an array/Python list or if it
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/publish.py/check_multiple_connections_for_textures--crossover with--dataset/ETHPy150Open enthought/mayavi/tvtk/array_handler.py/is_array_or_vtkarray