Button Strip parmTemplate
1933
1
0
Leaf
Member
12 posts
Joined: May 2017
Offline
Oct. 25, 2018 5:22 p.m.
I'm writing a python script to generate spare parameters and I'm trying to create a button strip however I can't find find a way of doing it in python.
Using the hou.Node.asCode() function on a manually set up node gives the line:
hou_parm_template = hou . MenuParmTemplate ( "parm5" , "" , menu_items = ([ "" ]), menu_labels = ([ "A" ]), default_value = 0 , icon_names = ([]), item_generator_script = "" , item_generator_script_language = hou . scriptLanguage . Python , menu_type = hou . menuType . StringToggle )
hou_parm_template . hideLabel ( True )
hou_parm_template_group . append ( hou_parm_template )
However using that code creates a normal menu parameter not a button strip.
Is there a way to create a button strip spare parameter with python? Or does this need to be submitted as a new RFE?
artiszin
Member
1 posts
Joined: March 2017
Offline
Jan. 7, 2024 10:40 a.m.
I know this is a really old post - had a similar problem so just thought I'd reply for other people who struggle with a similar thing.
I created a button on my shelf where you can enter a parm name and it kicks out the parm as code - which is a massive help.
This is what is kicks out for an example two button strip.
<hou.MenuParmTemplate name='slapcomp_switcher' label='Slapcomp switcher' menu_items
'0', '1') menu_labels
' Template Slapcomp ', ' Shot Slapcomp ') default_value=0 tags={ "export_disable" : "1", "script_
callback" : "exec(hou.parm("set_template").eval() )", "script_callback_language" : "python", } is_button_strip=1 strip_uses_icons=0>