Building HDAs
To get the current node use hou.node('.')
or hou.pwd()
To press a button deeper in the HDA use the following:
hou.parm("./deadline_submit1/submit").pressButton()
Nick Pfeiffer explains this well.
If you have a function in the asset’s python module you’d like to access, use the following:
hou.node(".").hdaModule().random_function()
# or...
hou.pwd().hm().random_function()
To get current node in a callback:
kwargs.get("node")
Add Parameter to Existing Folder
n = hou.node('/out/renderNode3')
parm_group = n.parmTemplateGroup()
target_folder = parm_group.findFolder((“Passes”,))
hou_parm_template2 = …
hou_parm_template3 = …
target_folder.addParmTemplate(hou_parm_template2)
target_folder.addParmTemplate(hou_parm_template3)
n.setParmTemplateGroup(parm_group)
Add Vexpression To HDA
{
`ifs(ch('../use_vex', chs('./preproc_vex')))
}
Reference embedded ‘extra files
You can embed files into an HDA through type properties > Extra Files.
For referencing those files from within the HDA, use the following syntax:
opdef:..?default_texture.jpg
Note: The ..
is a relative path to the HDA root. If this parameter is on the HDA itself and not inside it, it would just be opdef:.?default_texture.jpg
This syntax is often used for HDA Icons