Metashape allows to perform general workflow operations for multiple chunks automatically. It is useful when dealing with a large number of chunks to be processed. The workflow is suitable for Metashape Professional and Metashape  Standard.


This tutorial describes the use of batch processing feature for multiple chunks combined in a project. Each chunk includes a typical datasets that consists of the images of an object  (a wheel, a box, a statuette), the data is obtained with close range image capturing scenario and the main processing steps (that are applied to all chunks ) are:

  • Align Photos
  • Build Mesh
  • Build Texture

In this article the same processing stages with the same parameters are run for all chunks, however in the Batch Processing dialog it is possible to set parameters for each chunk separately if this scenario is preferable .


Batch processing can be applied to all chunks in the Workspace, to unprocessed chunks only, or to the chunks selected by the user. 


Add images to each chunk using Workflow > Add photos or Add folder commands before starting batch processing:




To start batch processing


1. Select Batch Process... command from the Workflow menu.


2. Click Add to select the desired processing stages.

3. In the Add Job dialog select the kind of operation to be performed, the list of chunks it should be applied to, and desired processing parameters. Click OK button when done. In the animation below you can see how you can specify parameters for Align photos process: 

4. Repeat the previous steps to add other processing steps as required.




We recommend enable the Save project after each step option.




5. Arrange jobs by clicking Up and Down arrows available on the right hand side of the Batch Process... dialog box.


6. Click OK button to start processing.


7. The progress dialog box will appear displaying the list and status of batch jobs and current operation progress. To cancel processing click the Cancel button.


In the Processed column the number of processed chunks and the total number of chunks are displayed (separated bu "/").



When the processing is finished, the dialog box displays the status of all jobs. If there were no problems during processing, then all the values in Failed column are zeroes. If an error occurred during processing, then the value in Failed column represents the number of chunks where the processing failed. 
For example, if out of three chunks, two had a problem on alignment step, then in the Failed column the value would be 2, and in the Processed column the value would be 1/3, see the illustration below:



Click Close button to close the Processing window.



You can view all models in Workspace:




The list of tasks for batch processing can be exported to XML structured file using Save button in the Batch processing dialog and imported in a different project using Load button: 




Import/Export



When the batch process includes import/export features that are applied to multiple chunks it is reasonable to use the following templates in the Path field of the import/export jobs:

  • {filename} - filename (without extension),
  • {fileext} - file extension,
  • {camera} - camera label,
  • {frame} - frame index,
  • {chunklabel} - chunk label,
  • {imagefolder} - folder containing images of an active chunk,
  • {projectfolder} - path to the folder containing current project,
  • {projectname} - current project filename,
  • {projectpath} - absolute path to the current project.


For example, you can define {chunklabel} variable in Export Mesh procedure and in this case each mesh will be named as the corresponding chunk. This would exclude the case when a new mesh overwrites the mesh for the previous chunk.