Search - User list
Full Version: Creating an HDA that Instantiates Multiple Nodes at Once
Root » Technical Discussion » Creating an HDA that Instantiates Multiple Nodes at Once
saitxmy
Hello everyone,

I'm currently facing a challenge with HDAs. I want to create an HDA such that when I instantiate it in Houdini, it automatically creates two or more nodes at once.


Does anyone have experience with creating multi-node HDAs, or could you point me to any resources or tutorials that might help with this? Your guidance and expertise would be greatly appreciated.

Thanks in advance for your help!
mapoga
I believe you need to create a custom shelf script that instantiate the 2 nodes. This is separate from creating the HDA itself.

Here is the content of the shelf tool labeled Karma from this file: $HFS/houdini/toolbar/ExtraLopTools.shelf
import loptoolutils
node = loptoolutils.genericTool(kwargs, 'karmarenderproperties', 'karmarendersettings')
node.setCurrent(True)
nodename = node.name()
kwargs['inputnodename'] = nodename
kwargs['inputs'] = [(nodename, 0)]
kwargs['nodepositionx'] = str(node.position().x())
kwargs['nodepositiony'] = str(node.position().y() - 0.5)
rop = loptoolutils.genericTool(kwargs, 'usdrender_rop')
rop.parm("rendersettings").setExpression('chs("../%s/primpath")' % nodename)
rop.parm("husk_instantshutter").setExpression('1 - ch("../%s/enablemblur")' % nodename)
node.setCurrent(True)
node.setSelected(True)
JordanWalsh
you can do this in the onCreate script of the initial HDA too..
saitxmy
JordanWalsh
you can do this in the onCreate script of the initial HDA too..
I've used the onCreate script successfully — thanks for that!
saitxmy
mapoga
I believe you need to create a custom shelf script that instantiate the 2 nodes. This is separate from creating the HDA itself.

Here is the content of the shelf tool labeled Karma from this file: $HFS/houdini/toolbar/ExtraLopTools.shelf
import loptoolutils
node = loptoolutils.genericTool(kwargs, 'karmarenderproperties', 'karmarendersettings')
node.setCurrent(True)
nodename = node.name()
kwargs['inputnodename'] = nodename
kwargs['inputs'] = [(nodename, 0)]
kwargs['nodepositionx'] = str(node.position().x())
kwargs['nodepositiony'] = str(node.position().y() - 0.5)
rop = loptoolutils.genericTool(kwargs, 'usdrender_rop')
rop.parm("rendersettings").setExpression('chs("../%s/primpath")' % nodename)
rop.parm("husk_instantshutter").setExpression('1 - ch("../%s/enablemblur")' % nodename)
node.setCurrent(True)
node.setSelected(True)

Thank you very much for your help!! it has solved my problem.
I have a small question, though. The tool is being automatically sorted into the "More" category in the tab menu. How can I reassign it to a different category?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB