So I'm trying to disable a button parameter via python using the parm.disable method however it doesn't appear to do anything.
Just as a test I rigged the button to disable when a toggle was ticked which worked fine. Then I tried to directly disable it purely via code for comparison. The .hide method which I also tested appears to work however the disable method, whilst working according to the returns from .isDisabled wasn't doing anything to the UI.
after a bit of poking around with hou.Parm.disable()
on top of Buttons - toggle parms don't reflect disable in UI (but became not toggleable anymore) - Ordered menus neither - RGBA Mask parms neither - Parts of Ramps don't reflect that in UI either - Neither of the Labels of any Parm (including Label Parm) … maybe some others, so clearly .disable behaves differently from disable rule
- folders disable folder Heading but not contents (however after selecting other node and back current one the content gets correctly disabled, buttons, toggles and others mentioned don't however)
- aaand Key Value Parm doesn't reflect disabled state even if disabled through disable rule
I was just recreating it ready to send some code and I found something else. To replicate what I was doing previously I added a test button and toggle to a standard environment light and for the sake of it I added a second button which is set to disable when { 1 != 1 } which I tried to enable via code and interestingly, it worked, however once the button was pressed it reverted to being disabled. The same was also observed in the first test button. It would appear that enabling a disabled node is possible, if only temporarily, however the reverse isn't true.
Anyway, as for code, these are the commands I was using to test the single button.
up again, I have found another frustrating behavior: once you disable a parameter via python, it won't stay disabled across sessions. I attached an example
I've a digital asset that is built specifically around the .disable() function… and I just discovered this show stopper… sad
I've been told that this bug won't be fixed because:
'disable' and ‘hide’ parameter states are meant to be dynamic and controlled by scripts. They are both controlled by “disable when” and “hide when” expressions, and the HOM functions are provided to expose this functionality to other dynamic scripts. Therefore, they have never been saved since the dawn of Houdini, and for backwards consistency and compatibility never will be.
I've been advised to use hidden parms to store the disable/hide status of a parameter and the use the ‘disable when’ field. The problem is that I need to disable ONLY certain components of a parameter, not all of them, like the image shows. And the ‘disable when’ user interface of the Edit Parameters Window only works on the tuple. It would disable all the components at the same time.
Do you know any workaround to permanently disable specific components? It only comes to my mind to use a script that perform the check/disable routine in the onLoad event handler section so it's run at each session start
I have this issue when disabling with Python xxx.parm("pathprefix").disable(True) which is showing the parameter is disabled but the tick still there And it will export to USD with the prefix