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.