Search the Community
Showing results for tags 'parmtemplate'.
Found 2 results
zrags posted a topic in ScriptingI'm trying to create and customize a node through a python script. I'm adding parms using the hou.parmTemplate() class and for one of the parameters I need to edit the Channel tab (see below). I can't seem to find anything in the python documentation on how to do this; anybody know what the best solution would be? Thanks!
Hi! I'm trying to find a way to read a config when a button is pressed, and update the available items in a menu parameter. I've tried a couple of methods, but haven't managed to get anything to work yet. First Attempt: target_menu_items = ["a", "b", "c"] menu_parm = node.parm("menu_parm") template = menu_parm.parmTemplate() template.setMenuItems(target_menu_items) The interface remains unchanged. Reading the docs that is understandable: So I tried what the docs recommended without any luck: ptg = node.parmTemplateGroup() menu_parm = node.parm("menu_parm") template = menu_parm.parmTemplate() template.setMenuItems(target_menu_items) ptg.replace("menu_parm", template) node.setParmTemplateGroup(ptg) I had some success by adding a line, but this isn't really a solution. template.setName("bahhumbug") I assume it's failing to replace the template if the name of the replacement template matches that of the existing one. I don't understand why that would be a problem though. I've had a thorough Google and can't find any examples of this... so I'm worried I'm approaching it the wrong way. Can anyone explain where I'm going wrong? Many many thanks in advance, Dan