meshlabxml/layers.py
def delete(script, layer_num=None):
    """ Delete layer

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        layer_num (int): the number of the layer to delete. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Deletes a layer
        will change current layer if deleted layer is lower in the stack

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = '  <filter name="Delete Current Mesh"/>\n'
    if isinstance(script, mlx.FilterScript):
        if (layer_num is None) or (layer_num == script.current_layer()):
            util.write_filter(script, filter_xml)
            script.del_layer(script.current_layer())
        else:
            cur_layer = script.current_layer()
            change(script, layer_num)
            util.write_filter(script, filter_xml)
            if layer_num < script.current_layer():
                change(script, cur_layer - 1)
            else:
                change(script, cur_layer)
            script.del_layer(layer_num)
    else:
        util.write_filter(script, filter_xml)
    return None
def delete(script, layer_num=None):
    """ Delete layer

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        layer_num (int): the number of the layer to delete. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Deletes a layer
        will change current layer if deleted layer is lower in the stack

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = '  <filter name="Delete Current Mesh"/>\n'
    if isinstance(script, mlx.FilterScript):
        if (layer_num is None) or (layer_num == script.current_layer()):
            util.write_filter(script, filter_xml)
            script.del_layer(script.current_layer())
        else:
            cur_layer = script.current_layer()
            change(script, layer_num)
            util.write_filter(script, filter_xml)
            if layer_num < script.current_layer():
                change(script, cur_layer - 1)
            else:
                change(script, cur_layer)
            script.del_layer(layer_num)
    else:
        util.write_filter(script, filter_xml)
    return None
Delete layer

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        layer_num (int): the number of the layer to delete. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Deletes a layer
        will change current layer if deleted layer is lower in the stack

    MeshLab versions:
        2016.12
        1.3.4BETA