Parameter Tags

   737   3   0
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
I'm intrigued by parameter tags used in an example that wasn't part of the query in another thread.
The 'convertvdb2' node in question is colored red.

In a for each loop a nodes paramter is using an hscript detail function:

detail(-1, 'iteration', 0) * 0.05

I couldn't find any specific reference to what the function does when it sees -1 rather than 0,1,2... which 'points' to the input.
I'm assuming -1 forces the function to look to a default place. I'm assuming it forces the function to look to some part of the node itself.

On that node that same node a spare parameter is created with some tags that are not the default for that parameter type.(I had to manually enter the same values when trying to work through recreating the example).

That spare parameter has no indication of any direct reference to the parameter that the detail function is placed and vic versa.

This is why I am thinking that the -1 defaults to looking to the node, because it too has no obvious link to the spare parameter.

The spare parameter itself has a direct reference to node which has the attribute being referred too, but it has some tags that seem to suggest it is 'pulling' that reference to the node(the vdb one) itself.

I say that because one tag - oprelative has the value of . which indicates to me a self-node reference
The tag opfilter has a value of !!SOP!! which I am assuming is doing some direction to just look at/assign ? the node itself.
And finally the cook_dependent tag has a value of 1 which I assume was put in there since the node is in a for each loop and each iteration will have a new iteration value so this forces the node to update with each loop cycle that triggers a cook?

I found a short section in the help docs and the only thing I could get out of it is that this seems to indicate something that is strictly python based (parameter tags):

“Tags” let you attach arbitrary key/value data to the parameter template. You can access this data using hou.ParmTemplate.tags.

I was wondering if anyone can comment and give a general description of how all this works?
Also, are these tags all based on python or are some tags non-python as well?

Attachments:
Parameter_Tags.jpg (467.2 KB)
iso_surfaces.hipnc (313.3 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
tags have nothing to do with -1 in the detail() function

tags simply configure parameters to have specific UI look or funcionality, some tags can only be added directly to Tags dictionary while others, are added automatically when configuring parameter using the UI, like yours opfilter is added when you set the OP Filter dropdown for Operator Path type parameter

now, the -1 in all functions that reference geometry from input, means to take the geometry from Spare Input rather than direct input
spare inputs start at -1 and continue -2 -3 -4, ...
you can add spare input from Cog Menu/Add Spare Input...
https://www.sidefx.com/docs/houdini/model/compile.html#spare [www.sidefx.com]
while they are described as a part of compiled blocks workflows they are not limited to use within compiled blocks
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
Thanks Thomas...just an additional note, the -1, -2 etc. references only work if the spare parameter created is actually named,
'spare_op0', 'spare_op1', etc.
Edited by BabaJ - Dec. 29, 2023 08:51:21
User Avatar
Member
8555 posts
Joined: July 2007
Offline
BabaJ
Thanks Thomas...just an additional note, the -1, -2 etc. references only work if the spare parameter created is actually named,
'spare_op0', 'spare_op1', etc.
right (i's spare_input0, ...), hence its easier you create them as I described and not manually:
tamte
you can add spare input from Cog Menu/Add Spare Input...
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links