Custom Preset Browser not always showing preset name

When you have a custom preset browser template linked to the script module and it uses a custom section for data filtering, the preset name isn’t displayed in the template’s text control.
The internal structure of a halpreset file looks like xml, but a custom preset from the script only saves the returned data without the xml layout.

Don’t know if this might point to the root of the problem.

Looks like this issue hasn’t been fixed yet.

@AposMus
Did you find any work around for this?

Yes.

You can look at the sub preset loader for Hot Brass to see how the internal path is treated via Connection and Export. (SubPresetSelectedPath is the internal template parameter for that.)

This gives you the full path though (c:\ … or vstsound:.…). In your template script you have to extract the file name before passing it on to SubPresetName.

source:match('^.+[\\/](.+)%..+$')

You also have to create a parameter in the script module to save preset name thought. Even just opening and closing Halion will reset the UI script and wipe the name from the text box.

Thanks @AposMus

You’re talking about the sample selector here, I guess. Which has a ui script. And the solution works well for this.

What about preset browser or preset browser custom which don’t have ui script so you can’t really access or modify the path?

I haven’t used this in the ‘standard’ preset browser template as it doesn’t have the section argument for the script module’s load callback. I only picked up this error of the name not showing when connecting to custom sections in the script module. For standard zone / layer / fx sections it seemed to work fine.

As far as the custom preset browser template is concerned, you can add your own script in the root of the template in edit mode, as with any template. That is where the Hot Brass layout comes in. Those same default template parameter names will work here.

Only difference is that the parameter you use to accept data from the SubPresetSelectedPath parameter needs a callback adjustment. Use the match pattern I posted.

yourPresetNameParamInternal = yourPresetPathParam:match('^.+[\\/](.+)%..+$')
yourPresetNameParamExternal = yourPresetNameParamInternal 

In the text box you can actually use yourPresetNameParamInternal instead of SubPresetName

1 Like

Thanks. That works perfectly. I didn’t know you can use the same parameters (SubPresetName, SubPresetSelectedPath) in preset browser custom. This is good to know. I guess this isn’t documented anywhere.

Actually it looks like you can also use @SubPresetName directly without the need to extract the name from path.

Extracting the filename comes in when you use the onLoadSubPreset callback with the script module used in the scope field and user sections.

I’ve had problems with this in the past where the SubPresetName parameter stops working and the name display goes blank. I haven’t checked if this is still true in 6.4.1

You’re right. Doesn’t work well with SubPresetName