meshlabxml/layers.py
def rename(script, label='blank', layer_num=None):
    """ Rename layer label

    Can be useful for outputting mlp files, as the output file names use
    the labels.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        label (str): new label for the mesh layer
        layer_num (int): layer number to rename. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Renames a layer

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = ''.join([
        '  <filter name="Rename Current Mesh">\n',
        '    <Param name="newName" ',
        'value="{}" '.format(label),
        'description="New Label" ',
        'type="RichString" ',
        '/>\n',
        '  </filter>\n'])
    if isinstance(script, mlx.FilterScript):
        if (layer_num is None) or (layer_num == script.current_layer()):
            util.write_filter(script, filter_xml)
            script.layer_stack[script.current_layer()] = label
        else:
            cur_layer = script.current_layer()
            change(script, layer_num)
            util.write_filter(script, filter_xml)
            change(script, cur_layer)
            script.layer_stack[layer_num] = label
    else:
        util.write_filter(script, filter_xml)
    return None
def rename(script, label='blank', layer_num=None):
    filter_xml = ''.join([
        '  <filter name="Rename Current Mesh">\n',
        '    <Param name="newName" ',
        'value="{}" '.format(label),
        'description="New Label" ',
        'type="RichString" ',
        '/>\n',
        '  </filter>\n'])
    if isinstance(script, mlx.FilterScript):
        if (layer_num is None) or (layer_num == script.current_layer()):
            util.write_filter(script, filter_xml)
            script.layer_stack[script.current_layer()] = label
        else:
            cur_layer = script.current_layer()
            change(script, layer_num)
            util.write_filter(script, filter_xml)
            change(script, cur_layer)
            script.layer_stack[layer_num] = label
    else:
        util.write_filter(script, filter_xml)
    return None
def rename ( script , label = 'blank' , layer_num = None ) : filter_xml = '' . join ( [ '  <filter name="Rename Current Mesh">\n' , '    <Param name="newName" ' , 'value="{}" ' . format ( label ) , 'description="New Label" ' , 'type="RichString" ' , '/>\n' , '  </filter>\n' ] ) if isinstance ( script , mlx . FilterScript ) : if ( layer_num is None ) or ( layer_num == script . current_layer ( ) ) : util . write_filter ( script , filter_xml ) script . layer_stack [ script . current_layer ( ) ] = label else : cur_layer = script . current_layer ( ) change ( script , layer_num ) util . write_filter ( script , filter_xml ) change ( script , cur_layer ) script . layer_stack [ layer_num ] = label else : util . write_filter ( script , filter_xml ) return None
Rename layer label

    Can be useful for outputting mlp files, as the output file names use
    the labels.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        label (str): new label for the mesh layer
        layer_num (int): layer number to rename. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Renames a layer

    MeshLab versions:
        2016.12
        1.3.4BETA
Rename layer label