How to generate 220 signatures for a VOP HDA with Python?

   604   2   0
User Avatar
Member
361 posts
Joined: June 2013
Offline
Hi

Trying to solve one annoyance I have with VOPs HDA not being able to type cast array depending if one of two inputs are array, the Snippet requires all data types are known beforehand, and when I tried to script the Inline VOP or even a Constant VOP signature, the VOP HDA would break when inputs changed.

To attempt to address this I'm going to create an HDA that does one thing; given two inputs, return the data type of the first input, where if both are single, the output is single, but if any is array, the output is array.

So signatures wise I will need to do all possible combinations of these data types:
float, integer, string, vector2, vector, vector4, matrix2, matrix3, matrix, dictionary, so, 10 data types, with 4 possible combinations for each type pairing for the two ports depending if they are array or not, e.g. for Float with itself:
Float - Float,
Float - Float Array,
Float Array - Float,
Float Array - Float Array

So there will be 40 signatures for float, 36 for Integer, 32 for String, etc, etc up to 220 signatures if my math is not failing me.



This is A LOT of signatures.... And I would much prefer to generate them programmatically then creating them by hand in the Input/Output tab in Type Properties.



I did look into type and definition classes for HDAs in Python and could not find methods to create signatures.

https://www.sidefx.com/docs/houdini/hom/hou/HDADefinition.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/hom/hou/NodeType.html [www.sidefx.com]


Any suggestion how I could accomplish this?
Maybe editing the HDA in unpacked version or Contents.gz?

Thanks
Edited by probiner - Sept. 5, 2024 10:39:53
User Avatar
Member
361 posts
Joined: June 2013
Offline
So the answer was to modify the "DialogScript" section with intended signatures properly generated into lines.
Ended up being 400 signatures... Not pretty but works... Will check if performance is terrible.



Thanks.
prb
User Avatar
Member
361 posts
Joined: June 2013
Offline
To add the info I got from support, shaderhda.pyand mtlx2hda.pydemonstrate native approaches to do this.

Cheers
prb
Edited by probiner - Sept. 19, 2024 13:32:03
  • Quick Links