Get list of events that are link synced

nonam3 wrote on 8/26/2022, 6:39 PM

Hello,

I would like to access all events that are link synced with selected event but unfortunately didn't found any manual / reference on subject.

To be more precise I'm talking about this option:

And what I want to achieve is to programmatically move all events that are related to "current" event. What I have affects only groups and I couldn't find information about access to `Sync Link'ed` events.

Any help more then welcome.

Best regards.

 

Comments

jetdv wrote on 8/27/2022, 11:08 AM

@nonam3 Here's what I'm seeing in the help file:

So if you manually set the "link", you can then use the menu option to select all of the ones that you linked together. Then there's what you can do from a script.

When you add a video/audio clip to the timeline, the two events are "sync'd" together. If you move them off sync, the difference is shown in red numbers.

In this case, the audio is 3 seconds off on the first one and 4 seconds off on the second one. Naturally, if there's no red number they are in sync. You can read this information from a script by using the evnt.SyncEvent property. That will return ONE event that it is sync'd to or null. If they are in sync, it will return null. If they are not in sync, it will return the other event. Here's some code that looks at that.
 

                foreach (TrackEvent evnt in myTrack.Events)
                {
                    TrackEvent syncEvnt = evnt.SyncEvent;

                    string s = "First Event Track " + evnt.Track.Index + "  Event " + evnt.Index + "  Type " + evnt.MediaType.ToString() + "  Name " + evnt.ActiveTake.MediaPath + Environment.NewLine;

                    if (syncEvnt == null)
                    {
                        s = s + "Sync is null";
                        MessageBox.Show(s);
                    }
                    else
                    {
                        s = s +  "Sync Event Track " + syncEvnt.Track.Index + "  Event " + syncEvnt.Index + "  Type " + syncEvnt.MediaType.ToString() + "  Name " + syncEvnt.ActiveTake.MediaPath;
                        MessageBox.Show(s);

                    }
                }

I'll do this up as a full tutorial as there are some other interesting things about this and have it out on September 12th. However, the ones that you manually set the sync on, that will not be seen from a script and you'll need to use the menu options to "see the ones that are linked".