www.jetdv.com Forum Index Edward Troxel
Vegas Scripting and Newsletters
Home of Excalibur and Montage Magic
 
 FAQ   Search   Memberlist   Usergroups   Register   Profile 
 Log in to check your private messagesLog in to check your private messages   Log inLog in 

Split by Sub-Markers

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Free Scripts
View previous topic :: View next topic  
Author Message
eXed



Joined: 14 Jun 2006
Posts: 3
Location: Ru

PostPosted: Wed Jun 14, 2006 2:37 pm    Post subject: Split by Sub-Markers Reply with quote

We are using markers in Sound Forge, for mark voice parts.
This is script split a Event by markers.


Code:

/*
   Sub-Markers spliter.js for Vegas 6c and above
*/

import Sony.Vegas;
import System;
import System.Windows.Forms;

  var evntsel = FindSelectedEvent();
 
  if( (evntsel != null) )
 {
   var activeTake = evntsel.ActiveTake;
   var media = activeTake.Media;
   
   if( (media != null) )
     {
      for ( var i = media.Markers.Count-1; i >= 0 ; i-- )
      {
          Vegas.Cursor = ( evntsel.ActiveTake.Media.Markers[i].Position  );
          evntsel.Split( Vegas.Cursor );
          Vegas.UpdateUI();
      }
     }   
 }

function FindSelectedEvent() : TrackEvent {
   var trackEnum = new Enumerator(Vegas.Project.Tracks);
   while (!trackEnum.atEnd()) {
       var track : Track = Track(trackEnum.item());
       var eventEnum = new Enumerator(track.Events);
       while (!eventEnum.atEnd()) {
           var evnt : TrackEvent = TrackEvent(eventEnum.item());
           if (evnt.Selected) {
               return evnt;
           }
           eventEnum.moveNext();
       }
       trackEnum.moveNext();
   }
   return null;
}


Sorry for my bad English.
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Wed Jun 14, 2006 2:52 pm    Post subject: Reply with quote

So... this basically looks like it will take an event and split it on all embedded marker locations.
Back to top
View user's profile Send private message Send e-mail
apocalypso



Joined: 15 Jun 2006
Posts: 5
Location: a little bit ot the left... up... left! there!

PostPosted: Thu Jun 15, 2006 7:08 am    Post subject: Reply with quote

Don't you have the equivalent for Vegas 5? i really need this script Very Happy
_________________
That! is what i said...
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
eXed



Joined: 14 Jun 2006
Posts: 3
Location: Ru

PostPosted: Thu Jun 15, 2006 8:57 am    Post subject: Reply with quote

Unfortunately i don't know how do it in Vegas 5.
Scripts can access to Markers in event only in Vegas 6c and above.
And Vegas don't have Trimmer class for scripting it.
Back to top
View user's profile Send private message
eXed



Joined: 14 Jun 2006
Posts: 3
Location: Ru

PostPosted: Thu Jun 15, 2006 12:30 pm    Post subject: Reply with quote

Edward, this script is small but very useful in everyday work process.
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Jun 15, 2006 1:13 pm    Post subject: Reply with quote

apocalypso wrote:
Don't you have the equivalent for Vegas 5? i really need this script Very Happy


The API commands to access the embedded markers were not added until Vegas 6. Therefore this one cannot be made to run in Vegas 5. I believe it WILL run in earlier versions of 6 than 6.0c but it will not run in 5. Vegas 6.0c is when Sony included a built-in script to pull embedded markers to the timeline.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Free Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group