Preset Location

Is the preset interface all maxscripted as well? I haven’t looked much into it yet, but am wondering if there’s a way to load preset from file – but point it to a specific file (in this case on the network somewhere) via a normal load dialog. I’ve got a shot where I’m borrowing a prt from somebody else, and the only way to get their render settings is to save a preset, then copyit manually. If it’s all scripted I’m sure i could do it myself… maybe i’m just missing where this feature is if it’s there?

Guess i’d want the same for save… =)

Is the preset interface all

maxscripted as well? I

haven’t looked much into it

yet, but am wondering if

there’s a way to load preset

from file – but point it to a

specific file (in this case on

the network somewhere) via a

normal load dialog. I’ve got

a shot where I’m borrowing a

prt from somebody else, and

the only way to get their

render settings is to save a

preset, then copyit manually.

If it’s all scripted I’m sure

i could do it myself… maybe

i’m just missing where this

feature is if it’s there?

Guess i’d want the same for

save… =)





Yes they are.



Copying manually to the presets folder is relatively easy though, because the “Explore Folder” button in the Presets and History rollout opens the correct location and then you just have to enter the “Presets” sub-directory and copy the file.



But you are right that a feature to move presets around would be easier. I will probably add one to simply point at a network folder, pick a preset and automatically move it into the local folder.



The UI code is a bit messy right now because we had to support both ActiveX in Max 8 and DotNet in Max 9+, but the functions to get load presets are defined in the “KrakatoaGUI.ms” file inside the “FranticParticleRenderMXSStruct” struct.



Unfortunately, the code requires the TreeView to be opened and populated to determine what settings to load (it builds the arrays of rollouts and controls currently in the GUI). You can force the dialog to open by running



Krakatoa_PresetDialogMode = #load

FranticParticleRenderMXS.displaySavePresetDialog()



and then selecting the file from the drop-down list.



So all you have to do is:



*Select the file on the network location

*Using copyFile(), copy it into the local Presets folder which by default is in a …\Plugcfg\Krakatoa\presets

*Call the above lines to open the dialog

*Select from the list and press LOAD.



I will add a scripted function to do this automatically by just providing a file name with an arbitrary path, but right now it is not designed to do that. It could be hacked by opening the TreeView dialog, setting the dropdown list and pressing the LOAD button via a script, but it is a bit ugly.





Btw, Krakatoa also fully supports the Max Render Presets (or the other way round, Max Presets support Krakatoa), so you can save one of those if you intend to move ALL data and not just specific settings.

Thanks again, SuperBobo! You’re always savin’ the day.

Here is the Hack:





fn loadPresetFromNetwork theSourceFile =

(

–build the name of the local preset file - it must be under Krakatoa’s presets folder

targetFile = GetDir #plugcfg + “\Krakatoa\Presets\” + fileNameFromPath theSourceFile

deleteFile targetFile --delete any pre-existing preset with that name from the Local folder

copyFile theSourceFile targetFile --copy from the network to the \Presets folder

Krakatoa_PresetDialogMode = #load --set the dialog to Load mode (global flag)

FranticParticleRenderMXS.displaySavePresetDialog() --open the dialog

–find the index of the preset name in the drop-down list

theIndex = findItem Krakatoa_SavePresetDialog.ddl_presetsToLoad.items (getFileNameFile targetFile)

if theIndex > 0 do --if it exists, set the selection of the list to that name

(

Krakatoa_SavePresetDialog.ddl_presetsToLoad.selection = theIndex

FranticParticleRenderMXS.loadSaveButtonPressed() --and press the LOAD button

)–end if

)–end fn



loadPresetFromNetwork “C:\temp\Krakatoa\test01.KrakatoaPreset” --pass a valid network or local preset name

Thanks again, SuperBobo! You’re always savin’ the day… and then some in this case. Thanks for the code block. =)