Jump to content
OdForest

Beginners question: Array attributes? What is binding?

Recommended Posts

Hey,

 

I'm reading the documentation and i don't understand something.

https://www.sidefx.com/docs/houdini/vex/snippets.html

When i see this, i understand it very well:

5c7b235c82dbc_Screenshot2019-03-03at01_44_10.png.3df5e18c9cb95283a3683189c9838493.png

But when i saw this, i got confused.

5c7b237dd5ccb_Screenshot2019-03-03at01_44_43.png.1ee248d2dadc6178a02d19f2fe3db337.png

First of all: Here an array is used together with (the creation of) an attribute. What is that? Are there array attributes? Doesn't make sense to me.

I also don't know what binding means, in this context. 

 

Hope to get a clearer understanding of what's going on here. Help would be appreciated. 

Share this post


Link to post
Share on other sites
3 minutes ago, DévinOdforce said:

First of all: Here an array is used together with (the creation of) an attribute. What is that? Are there array attributes?

yes, there are array attributes

4 minutes ago, DévinOdforce said:

also don't know what binding means, in this context.

http://www.sidefx.com/docs/houdini/nodes/vop/snippet.html#binding-geometry-attributes-to-vex-variables

Share this post


Link to post
Share on other sites

What is the usage of array attributes? Does it has like, multiple columns in the geometry spreadsheet, just as a vector attributes have 3?

Where can i read about them? In the array section of VEX i didn't read anything about it. The Geometry Attributes page is also not really talking about arrays.

So binding is just the 'importing' of attributes? .. Like, what you do when you type @?

Share this post


Link to post
Share on other sites

Hey!

Yup, they are like n-dimensional vector attributes.

Binding with @, will generate the attribute for the output if it did not already exist, or read it if it does.
One difference between using binding, and using attribute import, is that you can update the attribute throughout the code multiple times with binding.
On the other hand, using for example the point() expression, will always fetch the value of the attribute of the input (and not the intermediate value)

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/3/2019 at 3:39 AM, acey195 said:

On the other hand, using for example the point() expression, will always fetch the value of the attribute of the input (and not the intermediate value)

Do you mean something like using @ is like passing by reference and and point() is like passing by value/copy? (terms from the world of programming)

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)

In other words. If you use @ sign basically means that you are storing the value obtained form the function in an attribute called as you prefer. If later in the code you need to call the same value, you can just call it by using @value and you don't need to repeat the function again. In my limited knowledge of programming outside of Houdini I would say that more or less is what you said but is not just that.

 

In the second picture you posted I think at binding as "saving the attribute to the geometry". You don't always need to save attributes to the geometry, that's why they show you the array written like nbors[] and i[]@connected_pts.

Sometimes you need to know the value of the function just in the wrangle where you are writing your code and not outside of it. In this case you can use the first simple form for the array  nbors[]

Otherwise, if you need the attribute later on, you store it in the geometry adding @. 

 

 

Edited by Andrea

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×