MeshSet¶
The MeshSet class represents a container that allows to collect a set of Meshes,
where every Mesh corresponds to a layer of MeshLab.
From this class, you can apply all the filters of meshlab
by calling the meshlab.MeshSet.apply_filter()
method.
In every non-empty MeshSet, there is a selected mesh, that
can be accessed using the method meshlab.MeshSet.current_mesh()
.
-
class
meshlab.
MeshSet
¶ -
__init__
(self: meshlab.MeshSet, verbose: bool = False) → None¶ Initializes a MeshSet, setting the verbosity with the given value (default is
False
).
-
add_mesh
(self: meshlab.MeshSet, mesh: meshlab.Mesh, mesh_name: str = '', set_as_current: bool = True) → None¶ Adds a copy of the given mesh in the current MeshSet, with the given name. By default, the added mesh will be set as the current mesh. This behaviour can be changed by setting the arg
set_as_current
toFalse
.
-
apply_filter
(self: meshlab.MeshSet, filter_name: str, **kwargs) → None¶ Applies the filter having the given filter name in the MeshSet. Updates the current filter script, pushing the applied filter with the given parameters. See the List of Filters page to a list of all the possible filters that can be applied using this function.
-
apply_filter_script
(self: meshlab.MeshSet) → None¶ Applies all the filters currently present in the filter script.
-
clear_filter_script
(self: meshlab.MeshSet) → None¶ Clears the current filter script.
-
current_mesh
(self: meshlab.MeshSet) → meshlab.Mesh¶ Returns the current selected mesh of the MeshSet. Raises a
PyMeshLabException
if the MeshSet has no selected mesh.
-
current_mesh_id
(self: meshlab.MeshSet) → int¶ Returns the id of the current selected mesh of the MeshSet. Raises a
PyMeshLabException
if the MeshSet has no selected mesh.
-
load_filter_script
(self: meshlab.MeshSet, filter_script_name: str) → None¶ Loads from a .mlx file the current filter script.
-
load_mesh
(self: meshlab.MeshSet, file_name: str, **kwargs) → None¶ Loads the mesh in the given filename and adds the mesh in the MeshSet. The loaded mesh becomes the current selected mesh. Raises a
PyMeshLabException
if the file is not found, if the format of the file is not known by PyMeshLab or if there was an error while loading the file.
-
load_project
(self: meshlab.MeshSet, file_name: str) → None¶ Loads a project from the given file name and stores it in the MeshSet.
-
mesh
(self: meshlab.MeshSet, id: int) → meshlab.Mesh¶ Returns a reference to the mesh having the given id in the MeshSet. Raises a
PyMeshLabException
if the given ID is not found in the MeshSet.
-
mesh_id_exists
(self: meshlab.MeshSet, id: int) → bool¶ Returns true if the given id exists in the MeshSet.
-
number_meshes
(self: meshlab.MeshSet) → int¶ Returns the number of meshes contained in the MeshSet.
-
print_current_filter_script
(self: meshlab.MeshSet) → None¶ Prints all the filters present on the current filter script, with all the parameters and their values.
-
print_filter_list
(self: meshlab.MeshSet) → None¶ Prints the list of all the filters that can be applied in the MeshSet.
-
print_filter_parameter_list
(self: meshlab.MeshSet, filter_name: str) → None¶ Prints the list of the parameters of the given filter, with their default values.
-
print_plugin_list
(self: meshlab.MeshSet) → None¶ Prints all the meshlab plugins loaded in the current session of PyMeshLab.
-
print_status
(self: meshlab.MeshSet) → None¶ Prints the status of the MeshSet (number of meshes, and for every mesh its ID, its label and its full name.)
-
save_filter_script
(self: meshlab.MeshSet, filter_script_name: str) → None¶ Saves in a .mlx file the current filter script.
-
save_mesh
(self: meshlab.MeshSet, file_name: str, **kwargs) → None¶ Saves the current selected mesh in the MeshSet in a file having the given file name. Raises a
PyMeshLabException
if the MeshSet has no current selected mesh, if the format of the file is not known by PyMeshLab or if there was an error while writing the file.
-
save_project
(self: meshlab.MeshSet, file_name: str) → None¶ Saves the content of the MeshSet in a file having the given file name.
-
set_current_mesh
(self: meshlab.MeshSet, new_curr_id: int) → None¶ Selects as current mesh the mesh having the given ID. Raises a
PyMeshLabException
if the given ID is not found in the MeshSet.
-
set_versbosity
(self: meshlab.MeshSet, verbosity: bool) → None¶ Sets the verbosity when using the MeshSet class. When set to true, all the logs that usually are printed in the bottom left of MeshLab, will be printed when filters are applied.
-