FMOD Studio "onBuild" hook does not allow to change the project

Hello there,

I’ve been using FMOD Studio for a while already and recently my team has decided to leverage the scripting engine included with FMOD Studio to export custom information about our events.

I created a simple script that exports all markers associated with every event, their name and time position by running some extra logic in “onBuild” hook - works like a charm.

I then appended that logic with a routine that adds a special marker to each event in the project - we need it for a couple of reasons. Here is where I ran into the problems:

  • The marker would be added and it would be visible in the UI
  • Upon reloading into the project the marker will be gone
  • Version control also doesn’t detect any changes, the project title in FMOD Studio doesn’t have a (*) indicating there were changes

In summary, the marker would be added but it would not be persistent and would only be available in this particular session.

However if I just create a special button that runs custom logic (without using onBuild hook), then the changes would be picked up by the FMOD Studio, Version control and etc.

For example, this is the scenario when the changes do get picked up:

studio.menu.addMenuItem({ 
  name: "Custom\\Generate Events",
  keySequence: "Shift+Ctrl+B",
  execute: function() {
      _generateEventStartedMarkersForAllEvents() // adds a custom marker 
      studio.project.build()
  },
});

function onBuild(success) {
  _exportEventInformation()
}

studio.project.buildEnded.connect(onBuild);

This is the scenario when changes do not get picked up

studio.menu.addMenuItem({ 
  name: "Custom\\Generate Events",
  keySequence: "Shift+Ctrl+B",
  execute: function() {
      studio.project.build()
  },
});

function onBuild(success) {
    _generateEventStartedMarkersForAllEvents() // adds a custom marker 
    _exportEventInformation()
}

studio.project.buildEnded.connect(onBuild);

As you can see, I can use the workaround for now where I build the project with the custom script which adds the markers so I am not blocked - however, is there something I am missing or is this a bug? It would be nice to put everything in the onBuild hook since then when we onboard other developers, they can just use the regular Build process rather than a special button that is hiding in the Scripts dropdown.

So the markers don’t persist after adding them through script during a buildEnded callback, but they do if they are added during a menu button callback? Are you finding other changes persist if they are added during a buildEnded callback?
That does sound like a bug, what version of FMOD Studio are you using?

Sorry for the very late reply. We shifted away from using this logic entirely, but no changes seemed to persist if they were added during buildEnded callback.

We are using version 2.02.04.

Hi,

I have confirmed this issue and will pass it onto our dev team. Thanks for brining it to our attention.