Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: Kazama on December 19, 2020, 12:48:52 AM

Title: Reference preselection mode error
Post by: Kazama on December 19, 2020, 12:48:52 AM
Hi everyone,

I have been approaching Python for the first time in the last weeks and I'm now trying to write a script to automatize a Workflow in Metashape.
However, I have a problem with reference_preselection_mode. I need to set the Sequential option, but neither ReferencePreselectionSequential nor 2 (I found an old post where Alexey suggested to use 2, but actually it was for a previous version of Metashape).
If I input ReferencePreselectionSequential the error is:
 NameError: name 'ReferencePreselectionSequential' is not defined

If I input 2 the error is:
 ValueError: Invalid argument value: reference_preselection_mode
 (which I expected, but I did not know what else to try)

The script works fine as soon as I delete that line, so I there problem is 100% there. Am I doing something wrong?

Thanks to anyone who will help.
Title: Re: Reference preselection mode error
Post by: Paulo on December 19, 2020, 03:00:40 AM
I would try using:

Code: [Select]
reference_preselection_mode = Metashape.ReferencePreselectionSequential
in your chunk.matchPhotos line
Title: Re: Reference preselection mode error
Post by: Kazama on December 19, 2020, 04:03:45 AM
Thank you @Paulo, it was actually that simple.
Seems like I still have a lot to learn even on basics.

Best Regards