### Connect to Build Started Event Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Registers a callback function to be executed just before the bank build process begins. This function does not receive any arguments. Use `project.buildStartedDisconnect` to remove the callback later. An example demonstrates its usage. ```javascript project.buildStartedConnect( callback ) // Example: function buildStart() { alert("Build about to start"); }; studio.project.buildStartedConnect(buildStart); ``` -------------------------------- ### Playing FMOD Events via FMOD Studio API (C++) Source: https://www.fmod.com/docs/2.03/studio/getting-events-into-your-game This C++ code snippet demonstrates how to play an FMOD Studio event using the FMOD Studio API. It involves getting an event description, creating an instance, starting it, and then stopping it with a fade-out. Ensure the FMOD Studio API is initialized and linked correctly. ```cpp system->getEvent("event:/UI/Cancel", &cancelDescription); cancelDescription->createInstance(&cancelInstance); cancelInstance->start(); cancelInstance->stop(FMOD_STUDIO_STOP_ALLOWFADEOUT); ``` -------------------------------- ### Scripting FMOD Studio Marker and Region Setup Source: https://www.fmod.com/docs/2.03/studio/welcome-to-fmod-studio-revision-history Provides scripting functions for manipulating marker tracks, specifically for adding regions, transition markers, and transition regions. These functions (`addRegion`, `addTransitionMarker`, `addTransitionRegion`) enable automated setup of timeline elements. ```javascript markerTrack.addRegion("MyRegion", 0, 100); markerTrack.addTransitionMarker("MyMarker", 50); markerTrack.addTransitionRegion("MyTransitionRegion", 75, 125); ``` -------------------------------- ### FMOD Default Plugin Configuration Example (JavaScript) Source: https://www.fmod.com/docs/2.03/studio/plugin-reference This snippet shows how to define default configurations for an FMOD plugin. Each configuration has a name and a map of parameter values. ```javascript defaultConfigurations: [ { name:"Quiet", parameterValues: { "gain": -20, }, }, { name:"Bright", parameterValues: { "gain": 0, "freq": 5000, }, }, ] ``` -------------------------------- ### Configure SVN Server to Prefer IPv6 Source: https://www.fmod.com/docs/2.03/studio/using-source-control This command demonstrates how to start the SVN server service with the `--prefer-ipv6` option enabled. This can resolve performance issues related to IPv6 domain name resolution, particularly when the SVN server is running as a service. Adjust the paths to match your TortoiseSVN installation and repository location. ```shell "C:\Program Files\TortoiseSVN\bin\svnserve.exe" --prefer-ipv6 --service -r E:\SVN\Repository ``` -------------------------------- ### Accessing FMOD Studio Objects by Path and GUID in C++ Source: https://www.fmod.com/docs/2.03/studio/advanced-topics Demonstrates how to retrieve FMOD Studio event descriptions using their string paths and how to get a bus reference using its GUID. Assumes 'system' is a valid FMOD::Studio::System pointer and 'ERRCHECK' is a macro for error handling. Loading the 'strings.bank' is required for path-based event retrieval. ```cpp // Retrieving an event via the path FMOD::Studio::EventDescription* explosionDescription = NULL; ERRCHECK( system->getEvent("event:/Explosions/Single Explosion", &explosionDescription) ); // You can also use getEvent() to retrieve snapshots FMOD::Studio::EventDescription* snapshotDescription = NULL; ERRCHECK(system->getEvent("snapshot:/IngamePause", &snapshotDescription)); // Retrieving a bus via its GUID FMOD::Studio::Bus* sfxBus; ERRCHECK( system->getBus("{d320eb98-3d4a-4cd9-a001-fdb4e071c58e}", &sfxBus)); ``` -------------------------------- ### FMOD DSP Parameter Description Example (JavaScript) Source: https://www.fmod.com/docs/2.03/studio/plugin-reference This snippet demonstrates how to define DSP parameters for an FMOD plugin. It includes mapping parameter names to their display names and optional enumeration values for controls. ```javascript parameters: { "gain": { // FMOD_DSP_PARAMETER_DESC.name is "gain" displayName: "Volume" }, "freq": { // FMOD_DSP_PARAMETER_DESC.name is "freq" displayName: "Frequency" }, "outputMode": { // FMOD_DSP_PARAMETER_DESC.name is "outputMode" displayName: "Output", enumeration: ["Mono", "Stereo", "Surround"], // Mono = 0, Stereo = 1, Surround = 2 }, "pattern": { // FMOD_DSP_PARAMETER_DESC.name is "pattern" displayName: "Pattern", enumeration: ["Rain", "Hail", "Shine"], // Rain = 0, Hail = 1, Shine = 2 }, } ``` -------------------------------- ### Scripting API: Project Build Callbacks Source: https://www.fmod.com/docs/2.03/studio/welcome-to-fmod-studio-revision-history Adds callbacks `project.buildStarted` and `project.buildEnded` to the scripting API. These allow execution of custom commands or logic before and after project builds. ```javascript project.buildStarted.add(function() { /* code to run before build */ }) project.buildEnded.add(function() { /* code to run after build */ }) ``` -------------------------------- ### Select Event and Set Timeline Position in FMOD Studio Source: https://www.fmod.com/docs/2.03/studio/scripting-terminal-reference Provides a JavaScript example for locating an event by its GUID, opening it in the event editor, and setting the timeline cursor to a specific position. It uses `studio.project.lookup` to find the event and `studio.window.navigateTo` to open it. ```javascript var eventGUID = "{aabe5118-c144-4dc3-839a-ff52a2b49162}"; var timelinePos = 2.3; var event = studio.project.lookup(eventGUID); if (event) { studio.window.navigateTo(event); event.timeline.setCursorPosition(timelinePos); alert("Opened and scrubbed: " + event.name); } else { alert("Could not find event: " + eventGUID); } ``` -------------------------------- ### Build FMOD Banks with Options Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Builds FMOD banks for specified platforms and banks using the 'studio.project.build' method. Supports building individual or multiple banks and targeting specific platforms. Returns true on success, false otherwise. This function is essential for deploying audio assets. ```javascript studio.project.build(); studio.project.build( build_options ) ``` ```javascript // Single banks studio.project.build({ banks: 'Weapons' }); // Build the "Weapons" bank to all platforms studio.project.build({ banks: 'Music', platforms: ['Desktop', 'PlayStation 4'] }); // Build the "Music" bank for only the "Desktop" and "PlayStation 4" platforms // Multiple banks studio.project.build({ banks: ['Weapons', 'Characters'], platforms: 'Desktop' }); // Build the "Weapons" and "Characters" banks only for the "Desktop" platform studio.project.build({ banks: ['Weapons', 'Music'], platforms: ['Desktop', 'PlayStation 4'] }); // Build the "Weapons" and "Music" banks to the "Desktop" and "PlayStation 4" platforms // Platforms studio.project.build({ platforms: 'Desktop' }); // Builds all banks for the "Desktop" platform studio.project.build({ platforms: ['Desktop', 'PlayStation 4'] }); // Builds all banks for the "Desktop" and "PlayStation 4" platforms ``` -------------------------------- ### project.buildStartedConnect Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Connects a callback function to be executed before banks are built. ```APIDOC ## POST /project/buildStartedConnect ### Description Sets a function to be called before banks are built, with the signature `function()`. ### Method POST ### Endpoint /project/buildStartedConnect ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **callback** (function) - Required - A callback function that will be called when the build has started. ### Request Example ```javascript function handleBuildStart() { console.log('Build is starting...'); } // Assuming 'studio.project' is accessible // studio.project.buildStartedConnect(handleBuildStart); ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Callback connected successfully." } ``` ``` -------------------------------- ### Scripting Functions - studio.window.navigateTo Source: https://www.fmod.com/docs/_cn/2.02/studio/welcome-to-fmod-studio-revision-history Extended functionality for navigating to various elements within the FMOD Studio. ```APIDOC ## Scripting Functions - studio.window.navigateTo ### Description Navigates the FMOD Studio window to specific elements like effects, tracks, sounds, and mixer strips. ### Method None (Scripting API) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript // Example usage: studio.window.navigateTo(studio.project.Sound.findByName("my_sound")); studio.window.navigateTo(studio.project.Effect.findByName("my_effect")); ``` ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Looking Up FMOD Studio Objects by GUID in Script Source: https://www.fmod.com/docs/2.03/studio/advanced-topics Shows how to use the FMOD Studio scripting API to look up an object within the project using its GUID. Replace '%GUID%' with the actual GUID of the desired event. This method is useful for scripting within the FMOD Studio environment itself. ```javascript var myEvent = studio.project.lookup("%GUID%"); // Replace %GUID% with the GUID of your event. ``` -------------------------------- ### Return FMOD Event Playback to Start Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project-model-event Moves the playback position of an FMOD event instance to the cursor position if playing, stopping, or paused, or to the start of the timeline if stopped. Only the timeline playback position is affected. ```javascript Event.returnToStart() ``` -------------------------------- ### project.importAudioFile Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Imports an audio asset into the project's root audio bin folder. ```APIDOC ## POST /project/importAudioFile ### Description Imports an audio asset into the project. The file is always imported into the root audio bin folder. Use the `AudioFile.container` relationship to reassign it to another folder. ### Method POST ### Endpoint /project/importAudioFile ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **filePath** (string) - Required - The absolute path to the audio file's location. ### Request Example ```json { "filePath": "/path/to/your/audiofile.wav" } ``` ### Response #### Success Response (200) - **audioFile** (AudioFile | ManagedObject | null) - An AudioFile model, ManagedObject, or null if importing failed. #### Response Example ```json { "audioFile": { "id": "{some-guid}", "name": "audiofile.wav", "type": "AudioFile" } } ``` ``` -------------------------------- ### Disconnect from Build Started Event Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Removes a previously connected callback function from the build started notification. It's important to disconnect these signals when they are no longer needed to maintain application stability. The function requires the specific callback function to be disconnected. ```javascript project.buildStartedDisconnect( connectFunction ) // Example: function buildStart() { alert("Build about to start"); }; studio.project.buildStartedDisconnect(buildStart); ``` -------------------------------- ### project.exportGUIDs Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Exports the project's GUIDs to a 'guids.txt' file. ```APIDOC ## POST /project/exportGUIDs ### Description Exports project "guids.txt". ### Method POST ### Endpoint /project/exportGUIDs ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **success** (boolean) - `true` if the operation succeeds, `false` otherwise. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Scripting Functions - window Deck Source: https://www.fmod.com/docs/_cn/2.02/studio/welcome-to-fmod-studio-revision-history New scripting functions to retrieve deck selection information within FMOD Studio. ```APIDOC ## Scripting Functions - window Deck ### Description Provides access to deck selection information. ### Method None (Scripting API) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript // Example usage: let currentDeck = window.deckCurrent(); let selection = window.deckSelection(); ``` ### Response #### Success Response (N/A) - **currentDeck** (object/any) - Information about the current deck. - **selection** (object/any) - Information about the selected deck. #### Response Example ```json { "currentDeck": {}, "selection": {} } ``` ``` -------------------------------- ### Lookup ManagedObject by ID or Path Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Finds a ManagedObject within the project using its GUID or path. The function supports various types of paths including 'event:/', 'snapshot:/', 'bank:/', 'bus:/', 'vca:/', 'asset:/', 'parameter:/', 'effect:/', 'tag:/', and 'profilersession:/'. It can also find container items like folders. The input can be a GUID string or a formatted path string. ```javascript var item = project.lookup("{3a731ab3-ce6d-453d-862e-32050cecf68a}"); var event = project.lookup("event:/path/to/eventname"); var eventFolder = project.lookup("event:/path/to/foldername"); var bank = project.lookup("bank:/path/to/bank"); var snapshot = project.lookup("snapshot:/snapshotname"); var vca = project.lookup("vca:/vcaname"); ``` -------------------------------- ### Scripting: Navigate to Banks Source: https://www.fmod.com/docs/_cn/2.02/studio/welcome-to-fmod-studio-revision-history The script command `studio.window.navigateTo()` has been updated to now work correctly for Banks. This allows for programmatic navigation to Bank assets within the FMOD Studio interface. ```javascript studio.window.navigateTo(bank); ``` -------------------------------- ### Window Module API Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-window Functions for interacting with the FMOD Studio window context, including opening new windows, navigating to objects, and retrieving selections from various UI elements. ```APIDOC ## Module: Window The `studio.window` module allows for interaction with the window context. ### `window.open(windowType)` Opens a new window of the given window type (e.g. "Event Editor"). **Parameters** * `windowType` (string) - Required - The type of window to open. **Returns** * `boolean` - `true` if the window request is valid, or `false` otherwise. ### `window.navigateTo(managedObject)` Attempts to navigate to a ManagedObject in the UI. Will open a new window if required. **Parameters** * `managedObject` (ManagedObject) - Required - The object to navigate to. **Returns** * `boolean` - `true` if successful. ### `window.browserCurrent([tabName])` Returns the currently selected ManagedObject in the active browser tab of the last active window. A `tabName` can optionally be specified to select from a different browser tab. **Parameters** * `tabName` (string) - Optional - The name of the browser tab to select from. **Returns** * `ManagedObject` - The currently selected ManagedObject. ### `window.browserSelection([tabName])` Returns an `Array` of selected ManagedObjects in the active browser tab of the last active window. A `tabName` can optionally be specified to select from a different browser tab. **Parameters** * `tabName` (string) - Optional - The name of the browser tab to select from. **Returns** * `Array` - An array of selected ManagedObjects. ### `window.editorCurrent()` Returns the currently selected ManagedObject in the last active editor (e.g. in the multitrack view). **Returns** * `ManagedObject` - The currently selected ManagedObject. ### `window.editorSelection()` Returns an array of selected ManagedObjects in the last active editor (e.g. in the multitrack view). **Returns** * `Array` - An array of selected ManagedObjects. ### `window.deckCurrent()` Returns the currently selected ManagedObject in the deck of the last active window. **Returns** * `ManagedObject` - The currently selected ManagedObject. ### `window.deckSelection()` Returns an array of selected ManagedObjects in the deck of the last active window. **Returns** * `Array` - An array of selected ManagedObjects. ``` -------------------------------- ### project.lookup Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Finds a ManagedObject within the project using its path or GUID. ```APIDOC ## GET /project/lookup ### Description Lookup a ManagedObject by path or GUID. ### Method GET ### Endpoint /project/lookup ### Parameters #### Path Parameters None #### Query Parameters - **idOrPath** (string) - Required - GUID or path of the ManagedObject. ### Request Example ```json { "idOrPath": "event:/path/to/eventname" } ``` ### Response #### Success Response (200) - **managedObject** (ManagedObject) - The ManagedObject found by GUID or path. #### Response Example ```json { "managedObject": { "id": "{3a731ab3-ce6d-453d-862e-32050cecf68a}", "name": "eventname", "type": "Event" } } ``` **Note**: Paths are formatted using the pattern `type:/path/to/item`, where `type` can be `event`, `snapshot`, `bank`, `bus`, `vca`, `asset`, `parameter`, `effect`, `tag`, or `profilersession`. Paths can also be used to find container items. ``` -------------------------------- ### Scripting API: Find Available Plugins Source: https://www.fmod.com/docs/2.03/studio/welcome-to-fmod-studio-revision-history Provides the `studio.project.findAvailablePlugins()` function to query and retrieve a list of all plugins available to the FMOD Studio scripting system. This is useful for dynamic plugin integration and management. ```javascript const availablePlugins = studio.project.findAvailablePlugins(); console.log(availablePlugins); ``` -------------------------------- ### project.buildStartedDisconnect Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project Disconnects a previously connected callback function from the build started notification. ```APIDOC ## POST /project/buildStartedDisconnect ### Description Disconnects the `connectFunction` once it is no longer needed. It is important to disconnect the connected signals when they are no longer needed, otherwise they can accumulate and cause unexpected behavior. ### Method POST ### Endpoint /project/buildStartedDisconnect ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **connectionFunction** (function) - Required - The callback function to disconnect from build started notification. ### Request Example ```javascript // Assuming 'handleBuildStart' was the function connected previously // studio.project.buildStartedDisconnect(handleBuildStart); ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Callback disconnected successfully." } ``` ``` -------------------------------- ### Scripting: Navigate To Banks Source: https://www.fmod.com/docs/2.03/studio/welcome-to-fmod-studio-revision-history Ensures the studio.window.navigateTo() script command now functions correctly when targeting Banks. This allows for programmatic navigation within the FMOD Studio project structure. ```lua studio.window.navigateTo("BankName") ``` -------------------------------- ### Event.isOneShot Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project-model-event Reports whether an event is a one-shot event, meaning it is guaranteed to terminate within a bounded time after starting. ```APIDOC ## Event.isOneShot ### Description Reports whether an event is a one-shot. ### Method GET ### Endpoint `/Event/isOneShot` ### Parameters None ### Note This function requires the event to be fully loaded into memory and may be slow if called on many events. ### Response #### Success Response (200) - **isOneShot** (boolean) - `true` if the event is one-shot, `false` otherwise. #### Response Example ```json { "isOneShot": false } ``` ``` -------------------------------- ### Getting ManagedObject Document String Source: https://www.fmod.com/docs/2.03/studio/scripting-api-reference-project-managedobject Returns a string that describes the ManagedObject's entity type. This method is useful for understanding the type of a given object. It takes no arguments. ```javascript ManagedObject.document() ```