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
hou.ButtonParmTemplate and setJoinWithNext
3094 3 1- jacob clark
- Member
- 665 posts
- Joined: 7月 2005
- Offline
- are2d2
- Member
- 79 posts
- Joined: 4月 2011
- Offline
- graham
- Member
- 1922 posts
- Joined: 11月 2006
- Online
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.
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.
Graham Thompson, Technical Artist @ Rockstar Games
- JustinCrapse
- Member
- 7 posts
- Joined: 10月 2016
- Offline
Thanks Graham, this was a pain to figure out.
I have this wrapped up in a function for ease of use, but this code above should be accurate.
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.
-
- Quick Links