Andrea Posted October 2, 2019 Share Posted October 2, 2019 Hey guys! I'm creating a python script in an HDA. When the hda is created, this node is also going to create a null at /obj level and adds some parameters. What I don't like is that parameters that we usually find in this kind of null has not a clean interface but has already some parameters by default. I am trying to hide them using the suggested code https://www.sidefx.com/forum/topic/30708/. Using the following code I can hide one of the parameters (xOrd). ##### CREATING CONTROL NULL ###### ################################## def control(node, parms): import hou creation_place = hou.node("/obj") null = creation_place.createNode('null','CONTROL') ### HIDE INTERFACE OF NULL null_tg = null.parmTemplateGroup() copy_parm_template = null_tg.find(“xOrd”) null_tg.hide(copy_parm_template, True) #setting the template null.setParmTemplateGroup(null_tg) What I would like to do is to loop through all the parameters/folders and hide them all. But if I loop through all the parameters using null.parms() I am not able to make it work the hide function. Any hints? Quote Link to comment Share on other sites More sharing options...
LucaScheller Posted October 2, 2019 Share Posted October 2, 2019 (edited) Hi! This should work: creation_place = hou.node("/obj") null = creation_place.createNode('null','CONTROL') ### HIDE INTERFACE OF NULL null_tg = null.parmTemplateGroup() null_tg.hideFolder("Transform",True) null_tg.hideFolder("Render",True) null_tg.hideFolder("Misc",True) #setting the template null.setParmTemplateGroup(null_tg) Edited October 2, 2019 by LucaScheller 1 Quote Link to comment Share on other sites More sharing options...
Andrea Posted October 2, 2019 Author Share Posted October 2, 2019 Hi Luca! Thank you so much! It works perfectly Curious to see that you are calling the folders by their label and not by their name. I'm very new to this kind of stuff but I was so sure that functions need to reference to parameters and folders by their label only if we specifically look for them. Good to know I was wrong Quote Link to comment Share on other sites More sharing options...
LucaScheller Posted October 2, 2019 Share Posted October 2, 2019 (edited) 16 minutes ago, Andrea said: Hi Luca! Thank you so much! It works perfectly Curious to see that you are calling the folders by their label and not by their name. I'm very new to this kind of stuff but I was so sure that functions need to reference to parameters and folders by their label only if we specifically look for them. Good to know I was wrong Actually this was the first time I looked up on how to do this. I was really surprised that you have to use labels too instead of parm names, pretty unusual. Maybe I'm doing it wrong xD But it works, so Edited October 2, 2019 by LucaScheller Quote Link to comment Share on other sites More sharing options...
Andr1 Posted October 12, 2019 Share Posted October 12, 2019 just so you know and go crazy like I did, one issue with doing that with python is that parms hidden won't stay hidden across sessions. This is also the case with disabled parms. This issue is never going to be fixed. A workaround is to create a hidden toggle for driving the expressions 'Disable When' and 'Hide When' for each parm you need to hide/disable. I really don't like this workaround, but it seems the only option if you really need consistency across sessions? Quoting from the Support: Quote I am told the '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. Quote Link to comment Share on other sites More sharing options...
Andrea Posted October 14, 2019 Author Share Posted October 14, 2019 Thanks for letting me know ahead! I haven't encountered this issue yet, so I haven't spent much time solving it. Luckily in my case I can also just create a folder for all the parameters created by python but definitely would have been much cleaner to hide the parameters in a standard way, without workarounds Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.