attr wrangle vex

   2140   2   1
User Avatar
Member
12 posts
Joined: April 2019
Offline
Hi Everyone

I got hold of the master class 16.5 and went through some of the nodes.
I am struggling to find documentation on vex, I am a few days old houdini user so I know its me. I am use to go to technical documentation for maya to find out what syntax means for python in maya and wondering if there is something similiar in houdini.

Is the best way to highlight the word and press F1? Also assuming if the words are purple/pink it means its vex syntax. Also the @ sign indicates it's a attribute? The rest would be variables set by the user right?

For example, the following code on the second line throws me a bit:

float u = float(vertexprimindex(0, @vtxnum)) / (@numvtx-1);
u = u * u * u;
u = 1.0 - u;
@width = 0.005* u;

I read the code as follows:

float variable u is equal to float vertex primitive index. The 0 is the index pointing to the first geometry that is in the network. If there was 2 geometry pieces you could say 1 there and it would choose that geo right?
the second paramater is attribute vertex number. But can't find any documentation on @vtxnum to explain more about it or is this where houdini goes, you peanut you should know this
So @vtxnum = the total vertex count of the geometry
@numvtx = not sure to be honest
hoping the next line will make more sense (u = u …) when I understand the first 2 lines.

What would help is if I could visualize or show the attribute in a clever way to learn the @ variables, maybe there is something like that already.

Sorry for my ignorance I hope to better next time promise!

Thanks in advance
User Avatar
Member
30 posts
Joined: July 2012
Offline
The why I could not say - no idea of the context. The what is easier I think. This is a code snippet that is run over vertices. @vtnum is the number of the vertex each time the code is called. The way to visualise I think is to use the geometry spreadsheets - anything you want to see define an attribute with that value and you see it is the geometry spreadsheet.

Attachments:
Screen Shot.png (403.7 KB)

User Avatar
Member
12 posts
Joined: April 2019
Offline
Thanks so much!

The code snippet is to thicken the guides created for fur. So it makes sense that your saying it steps through the vertices, then multiplying the value to increase/decrease the size.

Thanks one step closer, not completely cracked yet.
  • Quick Links