FMOD Scripting - Create New Event from DefaultEvent in Project

Hello.

Looking over the scripting api documentation, I see two mechanisms I can leverage to create new FMOD Events, studio.project.create(“Event”) and workspace.addEvent.

For my purposes, I have a default Event that we currently use to generate events from source assets. I’d like to use that default to create new events in scripting.

Is there a way to create an event using a default Event?

Alternatively, is there any way to deep clone the default event, if I retrieve it with a LookUp.

Thanks.

Currently it is not possible to create events from Defaults via scripting. You are able to find all defaults by putting all events into an array and iterating through it looking for if the isDefault property is true.

var allEvents = studio.project.model.Event.findInstances();
allEvents.forEach(function(event) {
    if(event.isDefault) {
        console.log(event.name);
    }
});

We are looking into ways to copy or create an event based on another event.

Thanks, due to the complexity of the default events in question, and the time consumption of trying to parse out on console the ways I might be able to add SendMixers and Automation via scripting, I’ve abandoned that route and resolved to just generate the blank events for authors to manipulate.

Nonetheless, I appreciate your time in replying!

Sorry to necro this thread, but is this possible with any later versions of FMOD? How would I go about doing so?

Also wondering if it’s possible to add a preset effect chain to an event via the API

Hi,

Unfortunately, there hasn’t been any progress on these.
The method provided by Richard for retrieving a list of the default devices still works, however, there isn’t a way to easily copy events. I will bump the ticket.

To find a list of all your presets you can use

var presets = studio.project.model.EffectPreset.findInstances();

Then for each Preset Effect you can check their variable presets[X].effect for ManagedObject:EffectChain. Then to add the Effect Chain to the Events Master Track you can use

events.masterTrack.mixerGroup.effectChain.addEffect(EffectChain)

Hope this helps!

Thank you Connor, super helpful.

1 Like