Vex Questions

   3053   1   0
User Avatar
Member
6 posts
Joined: Sept. 2015
Offline
Hey,

The last coding I did was with C64 a long time ago and I was never good in math or this kind of things..
My questions are probably kind of stupid but I want to learn Vex.

The @ like here “ int n = neighbourcount(0, @ptnum);

What is the meaning of this @ ?

When is use this like this..
What will happen if I use a ” 0 " as the first value in the brackets?
Or, why is there a zero… Not getting why there is a zero in this code..
I would expect something like 23723..

Thanks
User Avatar
Member
9415 posts
Joined: July 2007
Offline
@ is not part of VEX language directly
its a symbol in VEX Snippets that is used to bind to certain data within CVEX context, so something like a shortcut to various data such as:

get/set attribute or volume values, e.g.:
@P, @v, v@customvectorattrib, f@customfloatattrib, i@customintattrib, …
v@customvectorfield, …

get element ids or other data e.g:
@ptnum, @primnum, @vtxnum, @numprim, @numpt, ….

get some global data e.g:
@Time, @Frame, @TimeInc, ….

more here:
https://www.sidefx.com/docs/houdini14.0/vex/snippets#attributes [sidefx.com]


EDIT: oh and 0 in neighbourcount(0, @ptnum) means first input, 1 would be second input
so essentially it returns number of points directly connected by edges (aka neighbours) to the point number @ptnum (current point if iterating over points) of the first input geometry (0)
more here
http://www.sidefx.com/docs/houdini14.0/vex/functions/neighbourcount [sidefx.com]
http://www.sidefx.com/docs/houdini14.0/vex/functions/ [sidefx.com]
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links