FMOD Studio uses sequential labeling when copying and pasting markers. If we copy and paste a marker named A, it will create a marker named B, C, D and so on:
Sometimes we might need multiple markers to share a common name, especially when triggering the same action in our game engine. To facilitate this we can create a script to bulk rename a selection of markers. Create a new .js file in the scripts folder of your FMOD project and add following code to the file:
studio.menu.addMenuItem({
name: “Scripts\RenameMarkers”,
isEnabled: function () {
var markers = studio.window.editorSelection();
return markers.length > 0 ? true : false;
},
execute: function () {
var markers = studio.window.editorSelection();
var markerName = studio.system.getText("Marker Name", "");
for (i = 0; i < markers.length; i++) {
markers[i].name = markerName;
}
}
});
Select your desired markers in FMOD Studio and execute the script by clicking on the menu entry Scripts->RenameMarkers. A new dialog window will appear, asking to input the new marker’s name:
With studio.window.editorSelection();
we get an array of the selected markers. Then we just loop through the array and assign the text input to each marker’s name property.
Enter your desired name and click on OK. The markers will be renamed according to your inputted text.