Engine.loadUserPreset(var file) does not append the .preset extension when given a relative path string without one, contrary to the documented "extension auto-appended" behaviour. The result is a silent failure in exported plugins (the reportScriptError has no visible console there).
In ScriptingApi.cpp (ScriptingApi::Engine::loadUserPreset, ~line 3187):
userPresetToLoad = userPresetRoot.getChildFile(file.toString());
if (userPresetToLoad.hasFileExtension(".preset"))
userPresetToLoad = userPresetToLoad.withFileExtension(".preset");
The extension is only "added" when the string already ends in .preset, making the block a no-op. For extensionless input the path stays bare, existsAsFile() is false, and it bails via reportScriptError(... "doesn't exist").
This is easy to hit because Engine.getUserPresetList() returns paths without the extension, so the natural round-trip fails:
var list = Engine.getUserPresetList(); // e.g. ["00 INIT", "01", "02"]
Engine.loadUserPreset(list[1]); // silently fails - resolves to ".../UserPresets/01"
Engine.loadUserPreset(list[1] + ".preset"); // works (caller-side workaround)
Suggested fix
Append .preset when the resolved file lacks it, instead of when it already has it:
if (!userPresetToLoad.hasFileExtension(".preset"))
userPresetToLoad = userPresetToLoad.withFileExtension(".preset");
Found on the frontend/exported path (HISE current master, macOS), but the logic is platform-independent.
Engine.loadUserPreset(var file)does not append the.presetextension when given a relative path string without one, contrary to the documented "extension auto-appended" behaviour. The result is a silent failure in exported plugins (thereportScriptErrorhas no visible console there).In
ScriptingApi.cpp(ScriptingApi::Engine::loadUserPreset, ~line 3187):The extension is only "added" when the string already ends in
.preset, making the block a no-op. For extensionless input the path stays bare,existsAsFile()is false, and it bails viareportScriptError(... "doesn't exist").This is easy to hit because
Engine.getUserPresetList()returns paths without the extension, so the natural round-trip fails:Suggested fix
Append
.presetwhen the resolved file lacks it, instead of when it already has it:Found on the frontend/exported path (HISE current master, macOS), but the logic is platform-independent.