Get parameter list

hi everybody, is there a way to write a script where I can get the parameters present in the project? or maybe a parameter thet an event is using?
I’ve modified the ‘exportGUIDsHeader.js’ to export all events, banks, snapshot. but i’ve not found a way to have parameters.

thanks

To get a list of all parameter presets in your project you would use var allParams = studio.project.model.ParameterPreset.findInstances()

However, because the parameters are tied to event instances (local parameter) or the system (global parameter), you would not be able to get the GUID of the parameter until the event description or system have been instantiated at runtime. You will need a separate script to assist with that.

thanks Richard, I used instead “var par = object.getParameterPresets();” where “object” is the event i’m analyzing.
once I have the managed object (in this case ManagedObject:GameParameter) is there a way to retrieve the name of it? I just found ManagedOblect.id but I can’t find a way to have the name.
Thanks

That would be par[0].presetOwner.name (since par is now an array). You can print a list of all of an objects properties by using .dump() on most objects.

1 Like

Would you be able to provide the equivalent code for FMODUnity/C#? I can’t seem to find a way to reference my FMOD Project (I assume that’s what studio.project is). Thanks!

studio.project and the JS snippet you’ve quoted are part of the Studio Scripting API, which are seperate from the runtime FMOD engine. Outside of Studio, you cannot use this command since you don’t have access to the FMOD Studio application and project, only your exported banks.

At runtime, the closest alternative is to load the appropriate banks, and then retrieve parameter descriptions from the FMOD system or event. For global parameters, you can retrieve a list with Studio::System::getParameterDescriptionList. For parameters belonging to a specific event, you will need to get total number of parameters used by the event with Studio::EventDescription::getParameterDescriptionCount, and then enumerate them using Studio::EventDescription::getParameterDescriptionByIndex.

Alternatively, outside of runtime, if you have FMOD Studio open you can send your command via TCP/IP to the Studio application - ./Assets/Plugins/FMOD/src/Editor/EditorUtils.cs provides an example of how to do this with EditorUtils.SendScriptCommand().

Hey, thank you for the response. I’m trying to retrieve the list of global parameters with getParameterDescriptionList. I wasn’t 100% sure where to find Studio::System::getParameterDescriptionList, but I found a method by that name on EditorUtils? …and logged the results like so: FMODUnity.EditorUtils.System.getParameterDescriptionList(out FMOD.Studio.PARAMETER_DESCRIPTION[] parameterDescriptions); However, parameterDescriptions winds up being an empty array. I definitely have some global parameters being set, so I must be doing something wrong here. Can you help me find the mistake?

You’ll want to call Studio::System::getParameterDescriptionList on the FMOD Studio system that you’re using in game. With the FMOD for Unity integration, EditorUtils handles a system for any FMOD things you need to do specifically in the Unity editor (i.e. auditioning events, processing your events so they can be set up Unity editor components, etc.), and shouldn’t be used in game.

The Studio system that is used in game is handled by RuntimeManager, so the appropriate call would be FMODUnity.RuntimeManager.StudioSystem.getParameterDescriptionList(out FMOD.Studio.PARAMETER_DESCRIPTION[] parameterDescriptions).

1 Like

Thanks so much! That worked perfectly.