Hello,
I would like to set default settings with a Python script for MetashapePro GUI.
I use accetto/ubuntu-vnc-xfce-g3 to host a instance for MetashapePro GUI on a node. Every time the instance is redeployed and MetashapePro is reinstalled, the settings reset. So I would like to set my own default settings.
1. add default coordinate system
2. change "advanced preferences":
- Enable "Load camera location accuracy from XMP meta data"
- Disable "Enable VBO support"
- Disable "Enable rich Python console"
(If it works, no prio) 3. change default attributes of task "Align Photos":
- Accuracy: Highest
- Key point limit = 100,000
- Tie point limit: 10,000
I already tried on my local machine (MacOS):
1. change chunk.crs -> doesn't work outside of GUI
import Metashape
import shutil
with open('PATH-TO-PRJ-FILE') as f:
crs_text = f.read()
shutil.copyfile('PATH-TO-GEOID-TIF', '/Applications/MetashapePro.app/Contents/MacOS/geoids/GEOID.tif')
Metashape.CoordinateSystem.addGeoid('/Applications/MetashapePro.app/Contents/MacOS/geoids/GEOID.tif')
Metashape.app.document.addChunk()
chunk = Metashape.app.document.chunk
chunk.crs = Metashape.CoordinateSystem(crs_text)
chunk.updateTransform()
additionally I tried to change CRS with getCoordinateSystem:
crs = Metashape.CoordinateSystem(crs_text)
Metashape.app.getCoordinateSystem(crs)
2.
- Disable "Enable VBO support" works with Metashape.app.settings.setValue("main/enable_vbo", "0")
- I don't know the variable name for "Load camera location accuracy from XMP meta data" and "Enable rich Python console";
this didn't work for me:
Metashape.app.settings.setValue("main/console/enable_rich_console", "0")
Metashape.app.settings.setValue("main/load_xmp_accuracy", "1")
Versions:
- ubuntu: metashape-pro_1_8_1_amd64.tar.gz
- local machine (MacOS): Agisoft Metashape Professional Version: 1.8.0 build 13794 (64 bit)
Thanks for your help!