Hello! 👋
Please help me change the script 🙏.
Currently the script increases the "Rotation - X Center" parameter by 100 pixels in the Pan\Crop tool for each animation key of each selected video event ➡.
But I need to increase "Position - X Center".
This should move the entire panorama frame to the right.
Unfortunately, I could not find how to access this parameter in VegasAPI.
Thanks in advance!
Here is the script code:
using System;
using ScriptPortal.Vegas;
namespace PanCropShiftX
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
foreach (Track track in vegas.Project.Tracks)
{
if (track.IsVideo())
{
foreach (VideoEvent evnt in track.Events)
{
if (evnt.Selected)
{
ShiftPanCropX(evnt);
}
}
}
}
}
public void ShiftPanCropX(VideoEvent videoEvent)
{
VideoMotionKeyframes keyframes = videoEvent.VideoMotion.Keyframes;
foreach (VideoMotionKeyframe keyframe in keyframes)
{
VideoMotionVertex center = keyframe.Center;
// Shift the center along X by 100
VideoMotionVertex newCenter = new VideoMotionVertex(center.X + 100.0f, center.Y);
keyframe.Center = newCenter;
}
myVegas.UpdateUI();
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
PanCropShiftX.Class1 script = new PanCropShiftX.Class1();
script.Main(vegas);
}
}
}
