Notifications
Clear all

[Closed] Plugin UI Problem

Hi Everyone,

I am writing a basic scripted plugin that extends the helper class. I have set up the variables and the UI with no problems. However I have used a dropdown list at the top of the UI, and depending on the selection from this list (which is linked to a parameter), I want certain elements/controls of the UI to disable. When the user makes the selection the relevant code is run and the elements of the UI disable as required, but if I then click off my plugin instance to select another object, then when I return to selecting the instance of my plugin again then all the UI elements/controls are activated again (which is the initial state of the plugin).

I am using: (for example)

HelperPlugin.parameterRollout.UIElement.enabled = false

to deactivate the UI element, but this state is then getting lost/forgotten…

I assume the problem lies in the parameter information being stored perfectly, but the plugin has no way of storing the states of the corresponding UI controls. Is there a way in which these states can be remembered (i.e visibility/enabled)? For reselecting and scene loading and saving? It would be so useful.

If not, does anyone have any workarounds. Can a little script be run each time a plugin instance is selected? Seems messy, but probably possible…

Has anyone tried storing the state of a control as a separate parameter in the plugin, so that the state is then remembered? Could that work?

Any help would be really appreciated, since at the moment the UI has loads of elements/controls that are active when they dont need to be, which is really confusing for the user, and it is doing my head in!

Thanks for your time everyone.

Take care,

EverZen

2 Replies

You could store the selection index of the dropdown list in the param block of your plugin, and use the on rollout open event to enable/disable the controls based on the selection index.

Martijn

Cheers Martijn,

As always a simple and perfectly formed solution That has made life so much easier for the team using this plugin, since the UI is a lot more concise. Thanks!

I am really only just starting to get into scripted plugins, but they are so powerful! I have been writing macroscripts up until now, blissfully unaware of how much more was available!

Thanks for the tips

Everzen