This script worked and result is correct, thanks. Why the exported files are not identical from both scripts?
#export cameras coordinates and orientation as omega,phi,kappa (OPK) using exportCameras function
#compatibility: Agisoft PhotoScan Professional 1.2.6
# Define: Cameras output file
CamerasOPKFile = PhotoScan.app.getSaveFileName("Please specify export path and filename/opk:")
# Define: Coordinate system
CoordinateSystemEPSG = "EPSG::32632"
# DEFINE PROCESSING SETTINGS
print("---Defining processing settings...")
# INIT ENVIRONMENT
import PhotoScan
import math
doc = PhotoScan.app.document
chunk = doc.chunk
# SET COORDINATE SYSTEM
print("---Settings coordinate system...")
# init coordinate system object
#CoordinateSystem = PhotoScan.CoordinateSystem()
#chunk.crs = PhotoScan.CoordinateSystem( CoordinateSystemEPSG)
if not(CoordinateSystem.init(CoordinateSystemEPSG)):
app.messageBox("Coordinate system EPSG code not recognized!")
# define coordinate system in chunk
#chunk.crs = CoordinateSystem
#chunk.projection = CoordinateSystem
# EXPORT DATA:
# EXPORT CAMERAS
print("---Exporting camera positions...")
if not(chunk.exportCameras(CamerasOPKFile, "opk")):
app.messageBox("Exporting Cameras OPK failed!")
print("exported cameras to",CamerasOPKFile)