vex and new point node!!

   4331   2   1
User Avatar
Member
12 posts
Joined: April 2012
Offline
Hi guys, this my first post and i am new to Houdini love this app

i have question : how can i type this in vex so the new point node will understand it

1-$PT/$NPT

1-previous point/point number


the other thing is there website or video talk about the new point node i read the help but i can't find anything like what change and how to replace it. anyway sorry for bothering and for sure i am missing something
thank you.
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Someone else asked exactly the same thing just a few days ago.

1-float(@ptnum)/@numpt

should work. @ptnum is an integer indicating the current point number; (the first point number is 0). @numpt is an integer indicating the total number of points. The new Point node is just a single-line version of Attribute Wrangle that writes to a single attribute on that line, so any tutorials that cover VEX in Attribute Wrangle should do. There isn't a lot to it for single-line VEXpressions, though, so those tutorials may be more than you need for just this, but Attribute Wrangle is handy too, so it might be worth it anyway. You can also find miscellaneous snippets and tips scattered about on the forum and elsewhere, though it can take some searching to find specific things.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
8554 posts
Joined: July 2007
Offline
just make sure that's what you want
as $PT/$NPT will not return 0-1 number
so if you really want num that is 0 for first point and 1 for last you need to use
$PT/($NPT-1)

hence:
@ptnum/(@numpt-1.0)

or if your input is curves and you want 0-1 for each curve you can notice that there is already a preset on Point node for that:
vertexprimindex(0, @vtxnum) / (primvertexcount(0, @primnum) - 1.0)
Edited by tamte - March 6, 2017 11:22:25
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links