Collection of python scripts for Metashape.
metashape_scripts/
README.md
LICENSE
register_menu.py # Entry point to register menu in Metashape GUI
metashape_tools/ # Python package (importable)
tie_points_tools.py # tie points stats + filters + bbox removal
camera_tools.py # camera utilities (keep existing, cleaned)
chunk_tools.py # generic chunk utilities
markers_tools.py # markers import/export + triangulation helpers
incremental_alignment.py # incremental alignment + transfer-oriented
fiducials.py # Helpers for fiducial markers import
Download the current .whl file and install it following these instructions (using the name of the .whl file that you downloaded).
conda create -n metashape python=3.10
conda activate metashape
pip3 install Metashape-"XX".whl
pip3 install -r requirements.txtMetashape license: You need a license (and associated license file) for Metashape. The easiest way to get the license file, is by installing the Metashape Professional Edition GUI software (distinct from the Python module) and registering it following the prompts in the software (you need to purchase a license first). Once you have a license file (whether a node-locked or floating license), you need to set the agisoft_LICENSE environment variable (search onilne for instructions for your OS; look for how to permanently set it) to the path to the folder containing the license file (metashape.lic).
With Linux (Ubuntu 22.04), to permanently setup agisoft_LICENSE environment variable for floating license, modify your .bashrc file:
sudo nano ~/.bashrcadd the line (replace port and address with your values)
export agisoft_LICENSE="port"@"address"source ~/.bashrcCheck if the new environmental variable is present:
printenv | grep agisoftRefer to this guide.
Follow the official guide https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-metashape-professional-package
For Linux:
./metashape-pro/python/bin/python3.8 -m pip install "python_module_name"In Metashape app, if Reach Python Console does not work and gives the following error
Failed to import qtconsole.inprocess: libffi.so.6: cannot open shared object file: No such file or directory
Construction of rich console failed - using simple consoleYou need to manually install libffi6 with
wget https://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
sudo apt install ./libffi6_3.2.1-8_amd64.deb