Search - User list
Full Version: VEX: How could I move a point along Normal?
Root » Technical Discussion » VEX: How could I move a point along Normal?
Masoud
Hello;

How could I move a specified point along it's Normal, using point wrangle?
Here is my scene :
tamte
just multiply normal vector by the amount and add to P, set group only to points you want to move
Masoud
Thank you.
jsmack
You're using pointattrib and setpointattrib wrong. If you are running over points, then you can just bind. You are also using the wrong signature of chf. use float chf( string ) not float chf( string, float ). The signature you are using is to specify the point in time of an animated channel from which to sample the parameter.

@P += @N * chf('dist');

pointattrib is the old way of getting a point attribute, it is only used if you need the know whether the import was successful. Use point() if you need to get a value from a point other than the current one (or from a different input). Remember, an attribvop set to ‘runover points’ is already a loop. The code block is the code executed per ‘iteration’ of the loop, which for points is per point. Any bind (@varname) will refer to the current point's attributes to read or write.

setpointattrib is used for when you need to write the value to a point other than the current point. Generally it should never be used when run-over is set to points, as you already have a point to write to, the current point. The exception to this rule is when creating geometry per-point, and you need to set attributes of newly created points. Other cases are when you don't know the name of the attribute to be written in advance, but this can be handled in different ways.
Masoud
Thank you “jsmack”, good points.
Kareeem
If anybody would know how often I come back to this thread to get this line of code they would think I am crazy.
tamte
Kareeem
If anybody would know how often I come back to this thread to get this line of code they would think I am crazy.
you may be happy to hear that in H21 Peak SOP has option to mask by point attribute as well as provide custom direction attribute, so no more need to remember any code
https://www.sidefx.com/docs/houdini/nodes/sop/peak.html [www.sidefx.com]
pelos
what about the peak node? just simple move the slider
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB