Hi all,
Once again, thanks for the amazing software and support that you all provide.
I'm actually trying to create the capture photos ... option of the plan mission in python using metashape API.
In order to do so, i'd like to export the camera track as a .path file, then use it the viewpoint and capture viewpoint class.
Unfortunately, i do not manage to export the camera track as a .path file.
I actually have a metashape project with an animation generated thanks to the mission planning that i am trying to export using python
My code is :
doc = Metashape.Document()
doc.open(path=r"C:\Users\Thomas\Documents\projet_x2.psx")
chunk = doc.chunk
camtrack = Metashape.CameraTrack
camtrack.chunk = chunk
camtrack.save(r"C:\Users\Thomas\Documents\CameraTrack.path")
and i always get the error message
TypeError: descriptor 'save' for 'Metashape.Metashape.CameraTrack' objects doesn't apply to a 'str' object
that i can't solve.
In the api reference, the save option is really confusing and reclame a path as a string, that i can't solve :
save(path[, file_format, max_waypoints, projection])
Save camera track to file.
Parameters
• path (string) – Path to camera track file
• file_format (string) – File format. “deduce”: - Deduce from extension, “path”: Path,
“earth”: Google Earth KML, “pilot”: DJI Pilot KML, “trinity”: Asctec Trinity CSV, “au-
topilot”: Asctec Autopilot CSV, “litchi”: Litchi CSV
• max_waypoints (int) – Max waypoints per flight
• projection (CoordinateSystem) – Camera track coordinate system.
I also tried loading an existing .path file with :
camtrack.load(r"C:\Users\Thomas\Documents\CameraTrack_001.path")
but i get the same error.
Is anyone able to help me with this ?