Search - User list
Full Version: hou.ButtonParmTemplate and setJoinWithNext
Root » Technical Discussion » hou.ButtonParmTemplate and setJoinWithNext
jacob clark
I can't seem to get the ‘setJoinWithNext’ bit of Parm template working. Any tips?


node.addSpareParmTuple(hou.ButtonParmTemplate('dsfd','snt',tags={“script_callback”:“message ‘hi’”,“script_callback_language”:“hscript”},setJoinWithNext=1))

cheers,
-j
are2d2
yeah, very annoying. I can't seem to get it to work either…. seven years down the road.
graham
The problem is in how you are adding the parameter.

You are creating the parm template and then appending it to the end of the parameter layout on the node. When you do this, since there is no parameter after your new one the flag will be ignored/removed. The same thing basically happens if you manually add a parameter in the Edit Parameter Interface.

To get the result you want now, you need to add the parameters to the parameter template group belonging to the node, then update the node to use the new one. Again though, this flag is only valid if you are adding a parameter after the one you want to join next, or you insert the new parm before another one.

Unfortunately this wasn't an option back when Jacob originally posted his problem.
JustinCrapse
Thanks Graham, this was a pain to figure out.

ptg = your_node.parmTemplateGroup()
orig_pt = parm.parmTemplate()
pt = parm.parmTemplate()
pt.setJoinWithNext(True)
ptg.replace(orig_pt, pt)
your_node.setParmTemplateGroup(ptg)

I have this wrapped up in a function for ease of use, but this code above should be accurate.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB