Grey out parameters

How can we grey out parameters in the component editor in case they are not accessible?
Thanks

In the component editor you can toggle the “enable” parameter for each custom parameter. Another option is to toggle “read only” in that same section.

1 Like

Thanks.
In my particular case I need to disable the parameter depending on a menu. I have seen the “enable expr” option but I can’t find the right syntax.
I have tried something like:

if menu == 1

but that doesn’t work.

Ah now I’m confused what you’re trying to do, as you asked about how to set it in the component editor. What menu do you mean? Maybe add a screenshot.

Basically, when the menu is at index 1 (name1) I need to enable/disable a bunch of parameters in the component. I guess the “enable expr” is the way to go.

Ah in that case you can just place a Parameter Execute DAT in your component, and make it monitor the menu parameter in question.
Then write your Python code to disable/enable certain parameters of the parent in its “onValueChange” callback function, like this:
parent().par.Myparameter.enable= False
Wrap it in an if/else structure to make it behave depending on what value your menu has.

Ok, that makes sense. I thought we can do it with an expr straight away.
I will try that, thanks a lot!

@xbix You can also use enable expr and reference another parameter in your component.
i.e. me.par.Enableeq1

For a working example see Palette > Tools > equalizer

Is this working nowadays? If I create a new Container with a float named Float and a toggle named Toggle, and set the float’s enable expr to ‘me.par.Toggle’, it doesn’t respond to the state of the toggle. Curious if I’m missing something or if this is broken

I think this might have been fixed in 2020.26630 for a case like a Toggle - but I’m wondering if this can be implemented with a simple expr to evaluate a menu option - like me.par.Method=2. Not having much luck. But if menu (called Method) option is 0 then me.par.Method will disable the other parameter that I am trying to control - other options will enable it.

A post was split to a new topic: Custom Parameter Radio Button