FMOD Studio User Manual 2.02
The studio.project module provides access to objects within the project model.
Methods:
ManagedObject of the given entity name.ManagedObject and its references, if any, from the project.ManagedObject by path or GUID.Callbacks:
Properties:
Types:
model.Parameter types available.model.Parameter.Builds all the banks to all the platforms listed in the build tab of the preferences dialog.
project.build();
project.build(
build_options
)
{ banks, platforms }.Returns true if the operation succeeds, or false otherwise. Building individual banks also builds and updates your project's master banks and master bank strings files.
Example:
// 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
Returns a new instance of a ManagedObject of the given entity name.
project.create(
entityName
)
This will create any required child objects for the object (e.g. creating an Event will create and attach its EventMixer).
Deletes the ManagedObject and its references, if any, from the project.
project.deleteObject(
managedObject
)
Returns true if the operation succeeds, or false otherwise.
This is the equivalent to deleting an item in the user interface.
Exports project "guids.txt".
project.exportGUIDs()
Returns true if the operation succeeds, or false otherwise.
Returns an array of strings that lists all available plugins.
project.findAvailablePlugins()
Imports an audio asset into the project.
project.importAudioFile(
filePath
)
Returns an model.AudioFile, ManagedObject, or null if importing failed. The file is always imported into the root audio bin folder. Use the AudioFile.container relationship to reassign it to another folder.
Lookup a ManagedObject by path or GUID.
project.lookup(
idOrPath
)
Returns a ManagedObject found by GUID or path.
Example:
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");
Paths are formatted using the pattern type:/path/to/item, where type is one of:
eventsnapshotbankbusvcaassetparametereffecttagprofilersessionPaths can also be used to find container items, such as finding a folder in the event hierarchy.
Saves the project.
project.save()
Returns true if the operation succeeds, or false otherwise.
Callback triggered when an audio file has finished being imported.
Sets a function to be called when an audio file is imported, with the signature function(audioFile).
project.audioFileImported.connect(
callback
)
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.
project.audioFileImported.disconnect(
connectFunction
)
A callback that will be fired when a build has completed.
Sets a function to be called after banks are built, with the signature function(success). The success argument will be false if a build error occurs or the build is cancelled by the user, and true otherwise. For example:
project.buildEnded.connect(callback)
Example:
studio.project.buildEnded.connect(function(success) {
alert(success ? "Build has ended well" : "Build has ended badly");
});
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.
Example:
function connectToBuildEnd() {
alert("Build about to end");
}
studio.project.buildEnded.connect(connectToBuildEnd);
studio.project.buildEnded.disconnect(connectToBuildEnd);
A callback that will be fired when a build has commenced.
Sets a function to be called before banks are built, with the signature function(). For example:
project.buildStarted.connect(
callback
)
Example:
studio.project.buildStarted.connect(function() {
alert("Build about to start");
});
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.
project.buildStarted.disconnect(
connectFunction
)
Example:
function connectToBuildStart() {
alert("Build about to start");
};
studio.project.buildStarted.connect(connectToBuildStart);
studio.project.buildStarted.disconnect(connectToBuildStart);
The absolute path to the project's ".fspro` file on disk.
An enum corresponding to different distance attenuation roll-off types available to spatial effects.
distanceRolloffType: {
LinearSquared: 0,
Linear: 1,
Inverse: 2,
InverseTapered: 3,
Custom: 4,
}
An enum corresponding to different model.Parameter types available.
parameterType: {
Invalid: -1,
User: 0,
UserDiscrete: 1,
UserEnumeration: 2,
Distance: 3,
Direction: 4,
Elevation: 5,
EventConeAngle: 6,
EventOrientation: 7,
Speed: 8,
SpeedAbsolute: 9,
DistanceNormalized: 10
}
An enum corresponding to different loop modes of a loop region.
regionLoopMode: {
None: 0,
Looping: 1,
Magnet: 2
}
Describes a model.Parameter.
name: [string],
type: [number],
min: [number],
max: [number],
enumerationLabels: [array]
See Also: Event.addGameParamater, workspace.addGameParameter