Content.storeAllControlsAsPreset
-
Sub presets could be useful to save lfo shapes , just stumbled upon the need to do that so i thought I would mention it.
-
@d-healey said in Content.storeAllControlsAsPreset:
It's also not possible to add sub-folders in the file path.
Was this ever added? I'm playing with Content.storeAllControlsAsPreset() and I can only create a preset in the main User Presets directory. @d-healey Is there a way to set sub-folders?
-
@dustbro Not that I know of
-
@Christoph-Hart please?
-
What if you could just pass a
ScriptFile
object into these methods:Engine.loadUserPreset( String relativePathWithoutFileEnding) Engine.saveUserPreset(String presetName);
Then you can create subfolders, add new files etc. as much as you want.
const var f = FileSystem.getFile(FileSystem.UserPresets).getChildFile("MyFunkySubFolder/AnotherSubFolder/3LevelSubfolder/Mindblowing4LevelSubfolder/Preset.preset"); Engine.saveUserPreset(f);
The old functionality will remain the same (so passing in a String will do whatever it does now).
-
@Christoph-Hart Looks good!
-
That's perfect!
-
my only gripe with saveUserPreset() is that you have to load a preset first.
I had a method where I loaded an empty preset before saveUserPreset(), which was working great on everthing EXCEPT protools :( It didn't like the empty preset.Is there some method I'm overlooking to load a preset without changing your current control settings? It just seems backwards to me
Content.storeAllControlsAsPreset() was great cause you could skip the whole "load a preset first" thing.
-
@dustbro all a preset does is store and restore control settings, so what would be the point of a preset that didn't change the controls when loaded?
-
@d-healey that's kind of my point. You can't use saveUserPreset() without first calling loadUserPreset() or else the newly saved preset will be created in an unexpected location.
From my testing, you have to load an existing preset within the sub folder location you want to save to. Then saveUserPreset() makes a duplicate (child? ) of that file and saves the new data to it.
So if you want to save your current settings as a preset, having to loading a preset first (which would change your controls) seems counterintuitive.
Maybe @Christoph-Hart could clarify -
@dustbro ah I see the problem now, I think the changes proposed by Christoph will solve this already.
-
@Christoph-Hart said in Content.storeAllControlsAsPreset:
Then you can create subfolders, add new files etc. as much as you want.
@Christoph-Hart Any chance we can get this update on your radar?
-
Alright,
Engine.loadUserPreset()
accepts a file object now, so the minimal setup for loading and storing user presets via the native file browser is:function load(file) { Engine.loadUserPreset(file); } function save(file) { Engine.saveUserPreset(file); } // Place this anyway you like (button callbacks, whatever)... var shouldLoad = true; if(shouldLoad) FileSystem.browse(FileSystem.UserPresets, false, "*.preset", load); else FileSystem.browse(FileSystem.UserPresets, true, "*.preset", save);
-
-
@Christoph-Hart said in Content.storeAllControlsAsPreset:
FileSystem.browse(FileSystem.UserPresets, true, "*.preset", save);
@Christoph-Hart Is there a way to default the browser to open the User Presets folder when using this save function? I have FileSystem.UserPresets set, but the system browser opens the last location you've navigated to.
-
Can you guys help me track down a crash I'm getting when using Engine.saveUserPreset()?
Here's a simplified script to check out.
If I hit hit the button to create a preset called "test" and then hit the button again and either select an existing preset to replace or type "test" again, HISE crashes.HiseSnippet 1067.3ocsV0raaaDDdorYZjRUPCPP6UBcRpPUUJ0oo.AEQwxREBI1QHLIn2rWQtTZgI2kX4RaqFXzhh9FzWf9lz.zWf9FzGg1i8l5rKIEW4Z6DH.qSZ94a1uY1YlkSDbORRBWfrp9pEwDj0Ga6tfImOXNlxPi2CYcW68wIRhvIS0tKhwIIDejk0VemRgU0sQ5e+yS1EGhYdjRUHza3TOxyoQTYo1I8eFMLbD1m7JZjg26zerGmMfGxSA9rkcWTL16X7LxAXkaUrQV2ZnOUxEtRrjjfr1dWt+B247SYY9+FZBcZHQIzC4BAJS8HdnuhwJsnAyog9SJx6DDDkIkUgsxpB22depOck9xpwmnM3ThvrdXU45nWOS508CmdVFza6L5cOaWOAMVVZQws6XOlAWTAX3JvjVY9hp7GUrGvAOXxNQ3iIiDfvJDM2oa21NO3gca8350pWCtHRjNmfENOGOkD1y4acJvNiHGvih4LPnYiLyMTnJwrapTxYWMnb6MxNq50TXhEjCCTUBA.aDMj3t.Z6hTH0EHQSCkCOKFyRnvA1RGZUQSYtYiWm.AXhfjPjIeoRn3+qNrfTlmDf5jfOgzL.P0pds2VulC7aHaFkQ5nrThMyG.84YAfxBAmbVEGWv6bO8Jxw1PcHL0Hxz.mlEpTx4pU+LxqoB9oIDyL0HEZ6HEoj1NM97NwZMMZqygVO1IK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