Open AndrewCunliffe opened 3 years ago
Why do we think there is a compatibility issue? Is a warning not more appropriate here?
@GlennSlade
Maybe warning is okay but how to warn effectively if running headless?
What is incompatible, how wrong would you expect it to be or will the script fall over if run on an old version?
Should fall over if run on too old a version, object names have changed over time and some functionality won't exist on older versions
In which case an error may be more appropriate.
Esp. for headless runs that might take 10 days to get wrong!
Probably worth introducing a compatibility check at least to script 1, to head off issues with the script potentially working in different ways on different software versions.
Checks the version and kills the execution if the hardcoded version numbers aren't consistent. I think this would be a good idea to introduce to our script? (at least script 1)?
Checking compatibility
compatible_major_version = "1.7" found_major_version = ".".join(Metashape.app.version.split('.')[:2]) if found_major_version != compatible_major_version: raise Exception("Incompatible Metashape version: {} != {}".format(found_major_version, compatible_major_version))
Example from https://github.com/agisoft-llc/metashape-scripts/blob/master/src/samples/general_workflow.py