Forum

Reference preselection mode error

Started by Kazama, December 19, 2020, 12:48:52 AM

Previous topic - Next topic

Kazama

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.

Paulo

#1
I would try using:

reference_preselection_mode = Metashape.ReferencePreselectionSequential

in your chunk.matchPhotos line
Best Regards,
Paul Pelletier,
Surveyor

Kazama

Thank you @Paulo, it was actually that simple.
Seems like I still have a lot to learn even on basics.

Best Regards