Agisoft Metashape

Agisoft Metashape => Python Scripting => Topic started by: chehroma on November 29, 2018, 11:35:41 AM

Title: ANIMATION
Post by: chehroma on November 29, 2018, 11:35:41 AM
Can somebody give sample script how to great animation and take avi file???? VERY important.
Title: Re: ANIMATION
Post by: Alexey Pasumansky on December 05, 2018, 08:21:17 PM
Hello chehroma,

Currently it is not possible to create or edit the camera track from Python scripts.

If you require to create the custom script, I suggest to use external modeling application and import the camera track from FBX format. Also the track can be created in Blender and saved in .path format, also support for camera track import. To allow .path format export in Blender it is necessary to install an add-on from the attached script:
 in Blender open File Menu -> User Preferences -> Addons -> User -> Install from file -> use osg_camera_export2.py script (attached), make it active by turning on the check box. Then use File Menu -> Export -> OSG Camera Animation (.path) option to save your track.

Title: Re: ANIMATION
Post by: chehroma on December 06, 2018, 07:14:46 PM
Thank for reply
Title: Re: ANIMATION
Post by: Alexey Pasumansky on December 07, 2018, 01:13:19 PM
Currently the .path file contains the following columns:
T, X, Y, Z, Qx, Qy, Qz, Qw

where T - is the time of the camera position (usually the values in this column go from 0 to the T_total - total duration of the track, with the regular step, i.e. frame rate),
X, Y, Z - coordinates of the camera location, Qx, Qy, Qz, Qw - quaternion that defines the orientation of the camera.

In case the project is georeferenced, the camera path should be defined in the LSE system (local coordinate system that is tangential to the ellipsoid).