Matt Carlson
Forum Replies Created
-
Matt Carlson
February 3, 2014 at 7:31 pm in reply to: Script to have sony vegas automatically add media to a layer?I should have it working by tomorrow.
-
Vegas extensions have a few directories that they run from but the easiest one to remember is My Documents\Vegas Application Extensions. So create a Vegas Application Extensions folder if one does not already exist in My Documents and put all three files in there.
You will find Black Tools under the Tools -> Extensions menu in Vegas. Use the Copy button in the extension (not Vegas copy or Ctrl-C) and then use the Paste Attributes button (as opposed to the Paste button which just does the effects chain.) A window will pop up and only check VideoMotion if Pan/Crop settings are all you want to paste.
-
Here it is. I have not released this officially yet because there is no documentation.
7089_vegasblacktoolsextension.rar.zip
Use the copy button in the extension instead of right click copy (one of the Attributes Memory buttons will turn green.) Select all of the events you need to paste to and hit the Paste Attributes button. A choice window will pop up.
-
I have programmed an extension that does copy and paste of attributes you choose. It requires Vegas 11 or higher. What version of Vegas are you running?
-
Matt Carlson
February 2, 2014 at 2:41 am in reply to: Script to have sony vegas automatically add media to a layer?It would really help to have a small sample of the video with two or three border changes in order to error proof this script. I pretty much have everything done but I need to know if color ranges are going to be a problem (i.e. is the light blue color consistent or does it need a small range for comparison.)
-
Matt Carlson
January 31, 2014 at 10:04 pm in reply to: Script to have sony vegas automatically add media to a layer?After thinking about it for a while this could be done without too much effort. The best way to go about it depends on some facts about your video that need clarification. Are the borders you are using to overlay actual video (animated) or are they static images? Are these images already prepared with transparent alpha? If the “talking heads” boxes do not move at all in frame (hopefully) then this is how I would do it.
1) Put all of your overlay borders in to ONE image on one track above the main video.
2) Use the Sony Cookie Cutter (in square mode) to get the effect you want on the first box. Write down the center and size of the square. Repeat for the other boxes.
With this information on the boxes cataloged a script can be written to write key frames for the Cookie Cutter easily using the SaveSnapShot script function. As I said before though SaveSnapShot can take a while. It is dependent on the main Vegas window preview quality. The process will go quicker if the preview quality is set to draft/half but that might make the analysis of where the blue border shows up a bit less accurate.
-
Matt Carlson
January 31, 2014 at 8:01 pm in reply to: Script to have sony vegas automatically add media to a layer?The VideoColor class is for defining a color to be used in media generation, track backgrounds, etc.
Unfortunately the Vegas scripting environment does not have access to any video frame information at all. The only exception to that is the SaveSnapshot function. A script could be written to save a snapshot and move the cursor position after each one. It is a clunky work around and it will be rather slow (the snapshot sometimes takes a second or more to actually happen… that is a second or more per frame) Working on each snapshot will then require a complete routine built from scratch to do the analysis since Vegas scripting was not designed for video manipulation.
The way Vegas was developed what you are asking for requires a plug-in. Writing a plug-in for a single set of circumstances is not worth the time in my opinion. It would be faster to just do the work by hand.
How long does the entire sequence of changing borders run for?
-
To install:
Place the Vegas Application Extensions folder in Windows – My Documents. It is not a script but an extension.
As far as Net Framework goes what you personally have installed and what Vegas accesses are two different things. Up until Vegas 10 the script/extension environment could only access 2.0. With Vegas 11 it went to 3.5. There is a config file or property somewhere that tell Vegas what level to use but I can’t remember how it is done.
-
It is a .cs script… but it looks like you figured it out already.
I could put user control in the script but I have already written a selection tool that does intervals and so much more as part of an extension. I was thinking of just putting the selection tool as it’s own stand alone extension and now seems like a good time to work on it. I will post it in a day or two.
-
Here you go.
using System;
using Sony.Vegas;class EntryPoint
{public void FromVegas(Vegas vegas)
{const int TrackNumber = 1; // Choose Your Track Number Here
const int Interval = 2; // Choose Your Interval HereTrack t = vegas.Project.Tracks[TrackNumber - 1];
bool go = false;
int counter = Interval - 1;
foreach(TrackEvent ev in t.Events)
{
if (ev.Selected)
go = true;if (!go) continue;
counter++;
if (counter == Interval)
{
VideoEvent ve = (VideoEvent)ev;
VideoMotionKeyframe kf = ve.VideoMotion.Keyframes[0];
VideoMotionVertex tl = kf.TopLeft;
VideoMotionVertex tr = kf.TopRight;
VideoMotionVertex bl = kf.BottomLeft;
VideoMotionVertex br = kf.BottomRight;
VideoMotionBounds bound = new VideoMotionBounds(tr, tl, bl, br);
ve.VideoMotion.Keyframes[0].Bounds = bound;ve.Selected = true; // Not necessary but is a visual representation of the affected events
counter = 0;
}
}}
}