Search the Community
Showing results for tags 'ParmTemplate'.
Found 1 result
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