Engine.loadUserPreset for expansions?
-
Does Engine.loadUserPreset work with expansions?
When I use a relative path, it adds "User Presets" at the beginning. If I use an object from full path, it crashes.
-
Try this
@bendurso
-
@d-healey Thanks, it should be like this?
local wildcardReference = expHandler.getCurrentExpansion().getWildcardReference("UserPresets/" + "myPreset.preset"); Engine.loadUserPreset(wildcardReference);
This relative path it's not working. And I'm not sure how to convert this into an object
-
@bendurso Do you only have one column in your preset browser?
-
@d-healey Oh yeah I forget the folder, but still is returning a wrong full path with this.
The console returns:
User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}UserPresets/Category 3/Native Preset.preset doesn't existBecause it adds "UserPresets" before the {EXP::Auralis}
-
@bendurso What happens if you don't include "UserPresets/" in your relative path?
-
@d-healey It returns this:
User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}Category 3/Native Preset.preset doesn't exist
If I print this:
local wildcardReference = expHandler.getCurrentExpansion().getWildcardReference("UserPresets/Category 3/Native Preset.preset"); Console.print(wildcardReference);
It returns the correct path: {EXP::Auralis}Category 3/Native Preset.preset
But.. after inserting it on Engine.loadUserPreset, it adds the "User Preset" plugin full path (non expansion) at the beginning.
-
@bendurso I wonder if it only works in the compiled plugin
-
@bendurso I just found an example of where I used it, might help..
RhapsodyBoilerplate/includes/Expansions.js at main
RhapsodyBoilerplate - Boilerplate code used by Rhapsody.
Codeberg.org (codeberg.org)
-
@d-healey Thanks, I'm going to try... today I spent all day trying to make a custom preset browser with viewports (I almost got it), but I can't load the presets hehe.
-
@bendurso said in Engine.loadUserPreset for expansions?:
I spent all day trying to make a custom preset browser with viewports
Why?
-
@d-healey Because the searchbar don't work on expansions, and the button bounds "Add, Rename, Delete" can't be increased. Mainly for these two things.
-
@Christoph-Hart Does Engine.loadUserPreset works for expansion presets? How should be the proper way to reference the path? Thanks :)
-
@bendurso Did you try using
{EXP::Auralis}Category 3/Native Preset.preset
directly? -
@d-healey Yeap, doesnt work.
When you use a string path it adds "Plugin/User Presets" + the string path. (that's the error log of the console)
like this:
Plugin/User Presets/{EXP::Auralis}Category 3/Native Preset.preset -
@bendurso The only way it doesnt return an error is if I use a object full path to the preset with FileSystem.fromAboslutePath(), it starts loading a bit and Hise crashes.
-
@bendurso said in Engine.loadUserPreset for expansions?:
When you use a string path it adds "Plugin/User Presets" + the string path.
You mean
Engine.loadUserPreset("{EXP::Auralis}Category 3/Native Preset.preset");
? -
@d-healey Yeap, if you use that, the console returns:
User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}Category 3/Native Preset.preset doesn't exist
It directly searches inside the main plugin User Presets folder, so it's impossible to make it work.
-
@bendurso You said using a File object causes a crash. What about instead of using
fromAbsolutePath
you piece the path together, something like this:local rootFolder = Expansion.getRootFolder(); // I can't remember the proper function name local preset = rootFolder.createDirectory("UserPresets").getChildFile("myPreset.preset");
-
@d-healey I had also previously tried building the entire path that way and it doesn't work either :( I mean, it doesn't throw an error but it crashes.
I just tried in the compiled plugin, and it also crashes :(