how to create parameters for HDA from node by python

   2547   6   1
User Avatar
Member
2 posts
Joined: 11月 2020
Offline
I want to create a hda, and I wish the hda's parameters can be created by python, then I can control all the parameters of the specific sub-node on the hda's interface, anyone know how to realize that?

Attachments:
interface.png (98.6 KB)

User Avatar
Member
1 posts
Joined: 2月 2018
Offline
Hi, you might have already worked it out, but otherwise I've been looking into something similar and this might be of help:

found this post on gfxhacks [gfxhacks.com] with some very clear explanations and examples on how to create parameters through python in Houdini, and in combination with the Houdini documentation on parmTemplates [www.sidefx.com] it got me pretty far.

I've been running the creation of my parameters in the scripts section of the hda, where you can select some different event handlers on when to run the script, but I linked mine to a button parameter so it loads the script every time I press the button.

Not sure if this exactly what you're looking for but I hope it helps.
User Avatar
Member
6 posts
Joined: 7月 2022
Offline
Kimorizon
Hi, you might have already worked it out, but otherwise I've been looking into something similar and this might be of help:

found this post on gfxhacks [gfxhacks.com] with some very clear explanations and examples on how to create parameters through python in Houdini, and in combination with the Houdini documentation on parmTemplates [www.sidefx.com] it got me pretty far.

I've been running the creation of my parameters in the scripts section of the hda, where you can select some different event handlers on when to run the script, but I linked mine to a button parameter so it loads the script every time I press the button.

Not sure if this exactly what you're looking for but I hope it helps.
Thanks for the info, it's really helpful
User Avatar
Member
313 posts
Joined: 10月 2016
Offline
Creating parms is done by parmtemplates.


It should be easy to set parms

//pseudocode
hou.parm(parmname).set(parmvalue)
// and so on
Edited by SWest - 2023年9月2日 05:28:07
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
2 posts
Joined: 9月 2023
Offline
Hi. Is it possible to add parameters to an HDA on creation without unlocking the HDA itself? Essentially I'm looking to have a dummy or placeholder HDA and populate it through python on creation so that the HDA doesn't have to be baked out and can be updated just by changing the version of a python module, but I don't want to have to unlock the HDA ideally. Maybe I'm missing an obvious way to do this.

Thanks,
Matt
User Avatar
Member
313 posts
Joined: 10月 2016
Offline
mattomatic
Hi. Is it possible to add parameters to an HDA on creation without unlocking the HDA itself? Essentially I'm looking to have a dummy or placeholder HDA and populate it through python on creation so that the HDA doesn't have to be baked out and can be updated just by changing the version of a python module, but I don't want to have to unlock the HDA ideally. Maybe I'm missing an obvious way to do this.

Thanks,
Matt

Can’t say I’ve got a solution for you but am interested in what you are after.

I’ve experimented both with multiple parms with Python as data and generating parms from Python. Usually I avoid making HDAs but use plain subnets.

Was just thinking that it might be possible to make an über HDA with a list of Python ”generators”. When a selected snippet is run it can generate new subnets without any lock.

Maybe this is not what you want buy I’m just thinking.
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
2 posts
Joined: 9月 2023
Offline
I'm probably going about this the wrong way, but I wanted the convenience of an HDA to add to the /obj menu but without having to bake the parms and/or contents in. It would act like a placeholder and get populated on creation based on the version of the python modules being loaded at the time. This way if the HDA itself doesn't change but the python modules do, a new "version" of the HDA gets installed alongside the versioned python without having to open Houdini and save it out (I've been using the built in versioning, myNode::1.0, but that requires importing/editing/saving to version up - just to keep the version in line with the python project).

As I say, I'm probably approaching this the wrong way so I'm open to alternatives!
  • Quick Links