Parm state & conditionals not preserved in parmTemplateGroup

   782   2   1
User Avatar
Member
59 posts
Joined: April 2006
Offline
If I am making an OTL manually, and I use the Type Properties editor to copy a parm from a node inside the OTL to the OTL's parameter interface, any parm state (like if it is hidden) or conditionals are copied along with all the other parm properties.

But if I try to do this via Python, using the parmTemplateGroup from the inner child node and calling setParmTemplateGroup() on the OTL with it, no conditionals of any parms appear on the parms on the OTL, and (hidden) states are not preserved. In fact, when I query the parmTemplates in that group, t.conditionals() always returns an empty dictionary, even though conditionals clearly exist.

How do I get the parm state and conditionals to be preserved on the OTL's parm set when using setParmTemplateGroup()?

P.S. I've called hou.Node.updateParmStates() on the child node before getting its parmTemplateGroup, but that doesn't affect the data in the parmTemplates, only the parms themselves if queried.

UPDATE: I notice that this only seems to be the case when the inner child node is a 3rd party (compiled) plugin node, like a Redshift render ROP. Conditionals and such are preserved when the inner child node is itself an OTL I've made the usual way in Houdini's GUI.
Edited by jrcooper - July 28, 2022 13:55:07
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
Per your update, that's the expected behavior. For compiled nodes all the conditional magic is built into the C++ implementation itself so the parameters themselves don't have any way of knowing anything or presenting data in the fields since it's just done via a single C++ function that will enable/disable parameters based on the programmed logic. Wrapping things like that, particularly the Redshift ROP nodes is a huge pain and basically an exercise in futility given you have to try and deduce any UI behavior yourself
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
59 posts
Joined: April 2006
Offline
I had a feeling that was the case.

But then, how does the Type Properties editor manage to get it right when you do it "manually"?

EDIT: So even the Type Properties editor doesn't get it right for the Redshift_ROP node, or at least not anymore (something changed because a previous version of a Redshift ROP that I wrapped manually somehow preserved the conditionals even though none appear in the Type Properties interface for those parms). But it does for others like mantra and arnold ROPs. Very strange.
Edited by jrcooper - July 28, 2022 18:51:22
  • Quick Links