Save Preset in Path
-
Hey!
Quick question, using the
Engine.saveUserPreset()
function, how do I make it so the preset is saved in a particular folder in user presets. Specifically, I have this path:User Presets\Custom\User
and would like all user presets to be saved in that folder. Thanks! -
-
@d-healey Thanks David! Got another question however, when using the function, it opens up a save as prompt with the os file browser, it then makes a "fake" path for that preset file to go and then uses the
Engine.saveUserPreset()
function to actually create the file. The thing is, I have a variable which stores the location of theUser Presets\Custom\User
User
folder. Instead of making the os browser prompt for the save as path, I have a popup panel with a label that I can get text value for (same concept as my rename one). How do I make it so that I concatenate the user folder variable with the text value plus the preset part? It should look something like this:folderUser + lblTextEntry + ".preset"
. The problem is how do I make sure the concatenation works for all os's since the way the directories in multiple os's are separated can differ.Thanks!
-
@Casmat If you use forwarded slashes it should work
-
@d-healey
folderUser + "/" + lblTextEntry + ".preset"
So that should work across all os's?
edit: whilst converting the folder to string! -
@Casmat Yup. Test it, if it doesn't work then you can use
Engine.getOS()
and do it differently for each one. -
@Casmat Did you manage to do it? if so how
-
@Jay Using this:
Engine.saveUserPreset(folderUser.toString(File.FullPath) + "/" + saveTextField);
folderUser
is one of my subfolders in the UserPresets folder, then the to string converts that path to the full path and thesaveTextField
is the string the user entered as the name they want to save. Hope this helps!