-
Randomize clip order?
Posted by Devon Adkisson on May 9, 2010 at 9:44 pmI have a ton of clips of varying length, and I want to randomize their order in the timeline. Anyone have an idea on how to do it?
Jayme Gutierrez replied 11 years, 11 months ago 5 Members · 10 Replies -
10 Replies
-
John Rofrano
May 10, 2010 at 10:03 amVegas doesn’t do this natively. You would need to write a script to do this.
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Devon Adkisson
May 10, 2010 at 11:53 amThat was a given.
I’ve tried to use production assistant’s montage tool but no matter what I do it always changes the duration (There is no “just random this track”). I thought I had it with “Fit to region” by creating the region that was only as long as the total footage, but no, it went and changed all the clips to be the exact same length (NOT what I need)
I have no vegas scripting experience, so I wouldn’t even know where to begin. I need to take a video track (and its corrosponding audio track) and randomize the order of the clips (keeping the video and audio together of course)
I do know that foreach (VideoEvent videoEvent in events) {} will loop through all the clips I have selected, and a few other insignificant things, but nothing of real use.
-
Theo Van laar
May 10, 2010 at 7:21 pm‘It doesn’t seem to work with vegas pro 9.0d x64 :’
On my computer it works with excalibur and Vegas pro 9d 64bits. Even the length of the events is not affected…
Theo
-
Devon Adkisson
May 10, 2010 at 7:37 pmWell after I installed it I can no longer get to extensions through view-> extensions, and I don’t know where else it could be.
-
Jeremy Ashinghurst
February 27, 2011 at 7:44 pmI know this is a dead thread but today I had the same problem, about 50 clips that I wanted to randomize and I didn’t feel like installing a software pack to get this one thing done so . . . I wrote a script for it. I’ve never scripted in C# before so I’m sure it’s pretty ugly, but it gets the job done. it randomizes all the media events in a track by moving a random event to the current end of the track (but will not move linked audio and video tracks simultaneously). Of course i in no way gaurantee this script and recommend you duplicate the track you want to randomize prior to performing this script just to be safe.
//*******************************************************************
//* Program: Random Order
//* Author: Jeremy Ashinghurst
//* Updated: Feb 27 2011
//* Description: randomly order clips from a selected track. clips will be successively placed at the end of the same track they are from. All clips from that track will be moved!
//*------------------------------------------------------------------
//* Copyright: none
//*******************************************************************
using System;
using System.Diagnostics;
using System.Windows.Forms;
using Sony.Vegas;public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
Track track = FindSelectedTrack(vegas);
if (track != null)
{
if (track.Events.Count > 1)
{
Random RandomNumber = new Random();
for (int x = track.Events.Count;x>0; x--)
{
int r = RandomNumber.Next(x);
foreach(TrackEvent trackEvent in track.Events)
{
if (trackEvent.Index == r)
{
Timecode cliplength = trackEvent.Length;
trackEvent.AdjustStartLength(track.Length,cliplength,false);
}
}
}}
else
{
MessageBox.Show("Track must have at least 2 events", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("You must select a track before running this script", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}///
-
Jayme Gutierrez
August 22, 2014 at 11:26 amThanks so much Jeremy!
This is something I hadn’t even thought of looking for until now, and then bam, you nailed! Works like a charm, nice one.Programmers are the Stone Masons of tommorrow!
Cheers!https://youtu.be/aTzSxEqcHTI?a
Some contents or functionalities here are not available due to your cookie preferences!This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.
Reply to this Discussion! Login or Sign Up