How to compile a VOP network into a Single VOP Node?

   3853   8   1
User Avatar
Member
135 posts
Joined: Aug. 2014
Offline
Hello,
I need to implement the C arcsinh function in a Houdini attribute VOP network.

https://reference.wolfram.com/language/ref/ArcSinh.html [reference.wolfram.com]

The Houdini Trigonometric Functions VOP node does not include arcsinh.

https://www.sidefx.com/docs/houdini/nodes/vop/trig.html [www.sidefx.com]

So I built an arcsinh function as a VOP network.
I'd like to be able to collapse this network into a single VOP node.
I realize that I can put my VOP network into a subnet, and turn that into an HDA.
But I'd like to rebuild it as an atomic VOP node with an input and an output. i.e. in VEX.

I search the web for tutorials, but couldn't find any examples.
Could someone here point me to one?

Please find attached my proof of concept hip file. Which includes examples of similar trig functions; Hyperbolic Tangent (red), Arc Tangent (blue), and my Inverse Hyperbolic Sine (arcsinh) (green).




Thanks
Edited by jlapre - March 22, 2022 22:52:18

Attachments:
arcsinh.v004.hipnc (184.9 KB)
Screen Shot 2022-03-22 at 3.40.26 PM.png (229.5 KB)
Screen Shot 2022-03-22 at 3.44.31 PM.png (103.8 KB)

Jeroen
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
To save as a subnet of nodes, select the nodes and hit 'collapse into subnet'. Then clean up the inputs/outputs. Save the subnet as and HDA, right click->Create digital asset...

Alternatively, go to file-> new asset, and choose a VOPs Definition and VEX Builder Script network type. Add parameters and inputs and outputs, and then implement the node as VEX code in the code section.
User Avatar
Member
135 posts
Joined: Aug. 2014
Offline
Thanks for your reply, jsmack.
Its the second option I'd like to try:
file-> new asset, and choose a VOPs Definition and VEX Builder Script
But I can't find any tutorials on how to do that.
Do you know of any?
Thanks
Jeroen
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
jlapre
Thanks for your reply, jsmack.
Its the second option I'd like to try:
file-> new asset, and choose a VOPs Definition and VEX Builder Script
But I can't find any tutorials on how to do that.
Do you know of any?
Thanks

Not that I know of, but I'd start by inspecting some existing nodes for some examples of nodes defined in code. The VEX documentation is a very good source for learning general syntax and the lexicon of built-in functions.
User Avatar
Member
135 posts
Joined: Aug. 2014
Offline
The main thing I'm trying to figure out is how to set the inputs and the outputs of the HDA,
and how to reference the inputs and outputs in the vex function.
Jeroen
User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
Hi,

I created many single node compiled VOPs before this way:



You first have to create HDA parameters:



Then create corresponding inputs to these parameters as well as outputs:



Finally reference them in your VEX code using
$inputOutputName

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
135 posts
Joined: Aug. 2014
Offline
Thanks, animatrix_. Very helpful.
I got my arcsinh working as a VOPs VEX Builder Script!

Attachments:
Screen Shot 2022-03-23 at 8.37.43 AM.png (1.1 MB)

Jeroen
User Avatar
Member
5100 posts
Joined: Feb. 2012
Offline
Thanks looks useful Jeroen!
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
135 posts
Joined: Aug. 2014
Offline
Please find attached arcsinh (Inverse Hyperbolic Sine) VOPs VEX Builder Script HDA and example hip file.
Thanks
Jeroen

Attachments:
arcsinh_HDA_and_Example.zip (27.3 KB)

Jeroen
  • Quick Links