Krion Posted March 3, 2019 Share Posted March 3, 2019 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: But when i saw this, i got confused. 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. Quote Link to comment Share on other sites More sharing options...
anim Posted March 3, 2019 Share Posted March 3, 2019 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 Quote Link to comment Share on other sites More sharing options...
Krion Posted March 3, 2019 Author Share Posted March 3, 2019 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 @? Quote Link to comment Share on other sites More sharing options...
acey195 Posted March 3, 2019 Share Posted March 3, 2019 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) 1 Quote Link to comment Share on other sites More sharing options...
Krion Posted March 20, 2019 Author Share Posted March 20, 2019 (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 March 20, 2019 by that Abstract guy Quote Link to comment Share on other sites More sharing options...
Andrea Posted March 20, 2019 Share Posted March 20, 2019 (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 March 20, 2019 by Andrea Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.