Creating loop+transition regions using the scripting API?

Hi! I’m wondering if there’s a way to create loop regions, transitions, and transition regions using FMOD Studio’s scripting API?

I’m able to successfully create a marker track by using Event.addMarkerTrack() and then calling MarkerTrack.addNamedMarker(), but so far I haven’t found a way to add loop or transition regions. Is this functionality available / am I missing something in the Scripting API Reference?

Thanks!

Once you have the event in a variable you can add different markers and regions through the markerTracks array. The following is for version 2.00.06 and older.

var event = studio.window.browserCurrent(); // Grab the currently selected event in the browser
var markerTrack = event.markerTracks[0]; // Grab the first marker track
var namedMarker = markerTrack.addNamedMarker("Start", 0); // Creates a named marker called 'Start' at the beginning (0 second) position of the timeline
var region = markerTrack.addRegion(5, 10, project.regionLoopMode.Looping); // Creates a loop region at the 5 second position that is 10 seconds long
var transitionMarker = markerTrack.addTransitionMarker (5, "Start"); // Creates a named marker called 'Start' at the beginning (0 second) position of the timeline

Thanks so much for the response Richard! Just updated to 2.00.06 and with a few adjustments the code you provided works perfectly.

(I changed project.regionLoopMode.Looping to studio.project.regionLoopMode.Looping in line 4, and "Start" to namedMarker in line 5)

I can see these methods (and more) in the scripting reference now as well – https://fmod.com/resources/documentation-studio?version=2.0&page=scripting-api-reference-project.html#markertrackaddregionposition-length-name-loopmode

Thanks again for your help!