**Update on this - the script works fine on Mac OS - the issue persists with Windows 11**
This script has always done me well, however my most recent dataset has started throwing errors. I have rolled back to different versions of Metashape and the issue persists. I have also tried the script on a dataset it has previously worked on, it fails also.
The console says the following in Red"
2025-01-13 21:15:28 File "<console>", line 1
2025-01-13 21:15:28 import Metashape
chunk = Metashape.app.document.chunk
cameras = [camera for camera in chunk.cameras if camera.type == Metashape.Camera.Type.Regular]
while cameras:
camera1 = cameras.pop(0)
for camera2 in cameras:
if camera1.label.rsplit("_", 1)[1] == camera2.label.rsplit("_", 1)[1]:
cameras.remove(camera2)
scalebar = chunk.addScalebar(camera1, camera2)
scalebar.reference.distance = 0.14
break
print("script finished")
2025-01-13 21:15:28 ^
2025-01-13 21:15:28 SyntaxError: invalid non-printable character U+2029
>>>