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!
Creating an HDA that Instantiates Multiple Nodes at Once
1186 4 1- saitxmy
- Member
- 3 posts
- Joined: Aug. 2021
- Offline
- mapoga
- Member
- 10 posts
- Joined: Feb. 2017
- Offline
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
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
- Member
- 143 posts
- Joined: Feb. 2012
- Offline
- saitxmy
- Member
- 3 posts
- Joined: Aug. 2021
- Offline
- saitxmy
- Member
- 3 posts
- Joined: Aug. 2021
- Offline
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.shelfimport 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?
-
- Quick Links