Default expressions for multiparm block child parameters

   5833   2   2
User Avatar
Member
48 posts
Joined: March 2011
Offline
Is it possible to create an HDA that has a default python expression for a sub-parm of a multiparm block?

I'm trying to get the sub parameter “filename#” to have a default python expression that returns an appropriate file name. I'll also need the value of # to be passed into the python script somehow.

Since my multiparm block defaults to 0, no expressions for the sub parameters seem to be saved in my otl. I did find a file in the expanded otl called childNode.multiparm which seems to be hscript channel references linking the sub-parms in the child node to the sub-parms in the top level HDA. Does anyone know the syntax for this file? Is there a way to insert python expressions here? Is there some way to expand the value of #?

Thanks,
Andrew
User Avatar
Member
7899 posts
Joined: July 2005
Offline
Maybe you can just expand the CH variable:
http://www.sidefx.com/docs/houdini11.1/expressions/_globals [sidefx.com]
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
# gets replaced with the multiparm index when the new parms get replaced.

So, if you have an expression on your filename# set to:
hou.pwd().hm().getFilename(#)

it will replace that with
hou.pwd().hm().getFilename(1)
hou.pwd().hm().getFilename(2)
etc

for the actual parameters in the block.
Remember to set the parameter defaults in the HDA to be a python script, too.
  • Quick Links