import_meshes

menpo.io.base.import_meshes(pattern, max_meshes=None, landmark_resolver=None, textures=True, verbose=False)[source]

Multiple mesh import generator.

Makes it’s best effort to import and attach relevant related information such as landmarks. It searches the directory for files that begin with the same filename and end in a supported extension.

If texture coordinates and a suitable texture are found the object returned will be a :map:`TexturedTriMesh`.

Note that this is a generator function. This allows for pre-processing of data to take place as data is imported (e.g. cleaning meshes as they are imported for memory efficiency).

Parameters:

pattern : str

The glob path pattern to search for textures and meshes.

max_meshes : positive int, optional

If not None, only import the first max_meshes meshes found. Else, import all.

landmark_resolver : function, optional

If not None, this function will be used to find landmarks for each mesh. The function should take one argument (a mesh itself) and return a dictionary of the form {'group_name': 'landmark_filepath'}

texture : bool, optional

If False, don’t search for textures.

verbose : bool, optional

If True progress of the importing will be dynamically reported.

Raises:

ValueError :

If no meshes are found at the provided glob.