Select Events Within Regions

wwaag wrote on 11/13/2013, 5:57 PM
I'm looking for a way to select all the events within all regions. I have Vegasaur and Timeline Tools, but neither seems to provide that capability. Does anyone know of a script that does this or could be easily modified to accomplish this task? Thanks.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Comments

Gary James wrote on 11/13/2013, 9:06 PM
Odds are, this would have to be a custom script to do specifically what you want. I say this because you have to remember that Markers and Regions are global to the Timeline. So unless you have some user input to specify which Timeline Track you want the Events to come from, you can't do what you want. And this makes me believe it greatly narrows the possibilities of finding a similar enough script to suite your needs.

How often do you run across the need to do this? Is this a normal workflow requirement to perform a specific editing task?
wwaag wrote on 11/14/2013, 10:59 AM
How often do you run across the need to do this? Is this a normal workflow requirement to perform a specific editing task?

Quite frequently. I'm doing road trip documentaries using footage from a dashcam in which a project consists of lots of short (3-5 sec) events. After the initial cuts editing, I want to review each event and somehow "mark" it if it needs to be stabilized. I then want to "select" the "marked" events, at which point, I can run my "deshaker" script in batch fashion.

My idea was to "mark" each event that I want stabilized by creating a region around that event. Once completed, I then need to "select" those events for which a region has been created. Presently, I manually step through the regions and "select" the events the normal way (Ctrl-Left Click). It works, but remains tedious.

Conceptually, it might work like this. For each event on the selected track, I test whether the start-end times correspond to a start-end time in my set of regions. If so, then I select that event. Unfortunately, my knowledge of scripting is limited at best. Thus the question of an existing script with "similar" elements that I could modify.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Gary James wrote on 11/14/2013, 2:20 PM
"My idea was to "mark" each event that I want stabilized by creating a region around that event. Once completed, I then need to "select" those events for which a region has been created. Presently, I manually step through the regions and "select" the events the normal way (Ctrl-Left Click). It works, but remains tedious."

You said you have Timeline Tools, so this may be a possible way you can have it do what you want. Basically this is what you need to do:

1. You'll add a Tag to each event that you want to edit. Press Ctrl-Shift-M to launch the Tag Editor, then click the tag input box to give it focus. You can now use the Up & Down Keys to make the Vegas timeline cursor move to the next or previous event.allowing you to preview it.

2. Type in any Tag you'd like - something like "x" would be fine. Hit enter to add the Tag to the Event. Next, select the new tag in the list, then right-click and select Copy Selected Event Tags from the context menu. This copies the "x" tag to the clipboard.

3. Click back on the Input box to give it focus, and then use the Up / Down keys to continue reviewing your events.

4. When you find an Event that you want to mark, simply press Ctrl-V to paste the "x" tag into the event.

5. When you're finished tagging all your events, close the Tag editor window.

6. From the TLT main display go to the Media Type Filter combo box and select Filter by Media Tags

7. enter "x" into the text filter Input box and hit enter.

8. The grid will now only display those events that have the "x" tag.

9. Press Ctrl-A to select all the events displayed in the grid.

10. Right-click on the grid and select Select all Highlighted Events in table ( deselect all others )

Once all your events have been Tagged, those tags will be saved with the project. From then on you can add more tags if you add more media. and repeat only those steps above that let you filter and select the events.
wwaag wrote on 11/14/2013, 4:53 PM
Gary,
Thank you so much for pointing me in the right direction. I finally got it to work, albeit a little differently. First the Ctrl-Shift-M didn't work for me at all. I finally checked the Media Tags item under the Project Views icon and assigned a name to one of the quick tags. Once I find an item I want to tag from the timeline, I left-click, select in Project Media list and then enter the quick-tag. Once I'm finished, I select the tag in the media list and it displays all the events I've tagged. I then select all, left click, and click "Select Timeline Events" and voila, all my tagged events are selected.

I did try using TLT as you suggested, but the Filter by Media Tags did not work for me. I entered the tag name, but no events were shown.

Again, thank you so much for your kind assistance.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Gary James wrote on 11/14/2013, 5:27 PM
I'm pleased to hear that I was able to spark your own ingenuity so you could come up with your own solution.

FYI, all of the Timeline Tools keyboard shortcuts only work if Timeline Tools itself has the focus. If anything in Vegas itself has focus, it swallows up all the keystrokes and doesn't pass them down to my extension. To give TLT focus is easy to do. Just click on the TLT main grid, and that's it.

Not sure why the Filter by Media Tags filter didn't work. If you start entering tag text in the Input box, the look-ahead drop down displays all the Tags that match the letters you've typed into the Input box. If you typed X as your tag, typing X into the Input box should have displayed that tag, and any others that start with X in the drop down.
Warper wrote on 11/15/2013, 4:00 AM
wwaag
You need something like this script:

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

try
{
for (var trackEnum = new Enumerator(Vegas.Project.Tracks); !trackEnum.atEnd(); trackEnum.moveNext())
for (var eventEnum = new Enumerator(Track(trackEnum.item()).Events); !eventEnum.atEnd(); eventEnum.moveNext())
if (!eventEnum.item().Selected)
for (var regionEnum = new Enumerator(Vegas.Project.Regions); !regionEnum.atEnd(); regionEnum.moveNext())
if (eventEnum.item().Start <= regionEnum.item().End &&
eventEnum.item().End >= regionEnum.item().Position)
{
eventEnum.item().Selected = true;
break; // breaks region loop, continues on next event
}
}
catch (e)
{
Vegas.ShowError(e);
}
wwaag wrote on 11/15/2013, 11:28 AM
Thanks. When trying to execute, I get the following error message:

C:\Program Files\Sony\Vegas Pro 12.0\Script Menu\select events within regions.js(15) : Expected ';'

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Gary James wrote on 11/15/2013, 1:18 PM
You should be aware that it looks like this script will select Events that fall within all of your assigned Regions On All Tracks If that isn't a problem then you should be OK.
Warper wrote on 11/15/2013, 2:48 PM
wwaag
fixed, works for me now
wwaag wrote on 11/15/2013, 7:15 PM
Thanks again. Executes now, but selects the event just before and just after each region in addition to events within the region.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Warper wrote on 11/16/2013, 3:01 AM
Sure it does. Script selects every event on every track that crosses region border or lies inside region.
You can change it in lines 12-13.
Event start timecode is in eventEnum.item().Start
Event end timecode is in eventEnum.item().End
Region start timecode is in regionEnum.item().Position
Region end timecode is in regionEnum.item().End

I believe you have enough knowledge of scripting to create whatever condition you need.
For example, here's condition for selection of event strictly inside region, not touching region borders:
if (eventEnum.item().End < regionEnum.item().End &&
eventEnum.item().Start > regionEnum.item().Position)
wwaag wrote on 11/16/2013, 4:15 PM
I finally got it sorted out the way I want--works perfectly. Thanks again for your help and your patience,

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.