Want to organise custom items in preference menu with title and border

Hi there,

I am wanting to add a menu in the Silhouette preferences to enable/disable all the custom python scripts I am loading. I am using the fx.prefs.add function in the scripts to create a tick box in the preferences which loads them when ticked, and ignores them when not.

fx.prefs.add("Artist Tools.Adjust Clone Frame Offset Keybind", True)

fx.prefs.add("Artist Tools.Change Exposure Keybind", True)

fx.prefs.add("Artist Tools.Change Paint Opacity Keybind", True)

fx.prefs.add("Artist Tools.Jump To Frame", True)

fx.prefs.add("Artist Tools.Reshape Toggler", True)

fx.prefs.add("Artist Tools.Swap brush size and clone offset controls", True)

fx.prefs.add("Artist Tools.Project Version Up", True)

This is working very well, however it would be great to be able to organise these and group them into ‘Keybinds’, and ‘Tools’.

For example, in the default Silhouette menu ‘Input/Output’, the items are grouped into ‘Silhouette Shapes’, ‘Nuke 6.2+ Shapes’ and ‘Nuke 9+ Shapes’ with a title and border like this:

How would I do this in my menu?

Thanks,
Josh

Put your subgroup after the main group title separated by dots. This will change the preference ID, but that is what provides the grouping on the preference page.

Ie:
Artist Tools.Keybinds.Change Exposure Keybind

Hi Paul,

Thanks for your reply!

When doing what you suggested, all the items are prefixed with the word of the subgroup in the preferences.

import fx


fx.prefs.add("Artist Tools.Keybinds.Adjust Clone Frame Offset Keybind", True)

fx.prefs.add("Artist Tools.Keybinds.Change Exposure Keybind", True)

fx.prefs.add("Artist Tools.Keybinds.Change Paint Opacity Keybind", True)

fx.prefs.add("Artist Tools.Tools.Jump To Frame", True)

fx.prefs.add("Artist Tools.Tools.Reshape Toggler", True)

fx.prefs.add("Artist Tools.Tools.Swap brush size and clone offset controls", True)

fx.prefs.add("Artist Tools.Tools.Project Version Up", True)

Is there any way of removing the ‘Keybinds.’ and ‘Tools.’ from the items?

Thanks,
Josh

Sadly, no - not at this time. I’ll add an option to specify the sub-group in our next maint release.

Ah sure thing. No worries, and thanks for your help!