Jump to content

Take attribute to set parameter


Recommended Posts

Hello
I want to take an attribute to put it in a node parameter how could I do?

I calculate a value with the node attribute wrangle and I would like to put this value in a switch

If you have doc / examples that would be cool 

Thank you,
Killian

Link to comment
Share on other sites

Hello Killian,

For a detail attribute, you can refer to the attribute with detail(surface_node, attrib_name, attrib_index)
https://www.sidefx.com/docs/houdini/expressions/detail.html

Here's an example for fetching the detail attribute "stop". surface_node 0 refers to the node connected to your switch, and attrib_index 0 is for attributes with more than one item (vector, array, etc). For integer/float, use 0.

detail(0, "stop", 0);

For any other attribute type, there is the matching point, prim and vertex functions, although I strongly recommend to use detail for node parameter stuff.
A parameter can only have one value (you generally cannot refer to an attribute and expect a different result for each point).

Also, note that to get a string attribute, you need the matching details(), points(), prims(), vertexs() function.
Read : detail string, point string, etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...