hello guys..
It match length well when length is extended than original by decreasing it.
and if video event is trimmed (using split S) then it works good by in extending.
but when make my event small by moving edge back then it dosnt extend.
using System; using ScriptPortal.Vegas; public class EntryPoint { public void FromVegas(Vegas vegas) { // Loop through all tracks in the project. foreach (Track track in vegas.Project.Tracks) { // Loop through all events in the track. foreach (TrackEvent trackEvent in track.Events) { try { // Only work on selected video events. if (trackEvent.Selected && trackEvent.MediaType == MediaType.Video) { // Get the original length from the active take of the event. Timecode originalLength = trackEvent.ActiveTake.Length; // Get the current length of the video event. Timecode currentLength = trackEvent.Length; // Check if the current length is less than the original length. if (currentLength < originalLength) { trackEvent.Length = originalLength; } else { // If the end of the event (start + length) is greater than the original end, adjust length. Timecode originalEnd = trackEvent.Start + originalLength; Timecode currentEnd = trackEvent.Start + currentLength; if (currentEnd > originalEnd) { trackEvent.Length = originalLength; } } // Adjust any associated audio events. foreach (Track otherTrack in vegas.Project.Tracks) { foreach (TrackEvent otherEvent in otherTrack.Events) { // Check for audio events that start at the same time as the video event. if (otherEvent.MediaType == MediaType.Audio && otherEvent.Start == trackEvent.Start) { // Set the audio event's length to match the video event's original length. otherEvent.Length = originalLength; } } } } } catch { // Handle any errors silently or log them as needed } } } } }
actually I need further
in this..
1. match length
2. then check if it is equal to 3 minute or more..if so then continue.
3 if its original length is less than 3 minute then we need to extend it to equal to 3 minutes but not paritlly.
i mean extend it with its origial lenght.
e.g. if original length is 2:58 then make it double extend in loop event it will become 5:56 but we will not make it 3:00 with just extend 2 second.