Forum

Author Topic: Reference preselection mode error  (Read 703 times)

Kazama

  • Newbie
  • *
  • Posts: 4
    • View Profile
Reference preselection mode error
« 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.

Paulo

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
Re: Reference preselection mode error
« Reply #1 on: December 19, 2020, 03:00:40 AM »
I would try using:

Code: [Select]
reference_preselection_mode = Metashape.ReferencePreselectionSequential
in your chunk.matchPhotos line
« Last Edit: December 19, 2020, 03:02:29 AM by Paulo »
Best Regards,

Paul Pelletier

Kazama

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Reference preselection mode error
« Reply #2 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