Engine.loadUserPreset | Load Preset From Button
-
@trillbilly What if you change to
Engine.loadUserPreset("INIT.preset");
-
That won't work. Your button is set to save in preset, that will trigger the button's callback each time a preset loads and create an endless loop.
You don't need an init preset. Just load the preset you want to be the init state before you compile your project and that will be the initial state the plugin is in when the user opens it.
-
@d-healey but what if I want a quick way for users to reset the default values without having to search the Preset browser?
-
@trillbilly Then have a button on the UI that isn't set to
saveInPreset
that can be used to load a preset. -
Also you need to pass in a file object or path, not a preset name:
Here's an example: loadPresetTest.zip
-
@d-healey Aayaya (my Mario voice), I got it, thank you...
-
@d-healey why this example not working for me , I am trying to use the button to load the presets , but fail.....
-
@huen97 its set up like this
inline function onResetButtonControl(component, value) { Engine.loadUserPreset("Factory/INIT.preset"); }; Content.getComponent("ResetButton").setControlCallback(onResetButtonControl);
with "Factory/INIT.preset" being the File Loaction and name or preset.
-
@trillbilly otherwise in the callback of your Button, put the state of each button or setting of your project. longer to perform but if the "init" preset is deleted, this function will remain unchanged
-
@yall Didnt think of this. Great observation!