Jump to content
Sign in to follow this  
Follyx

nodes in vex

Recommended Posts

dies this exist anywhere? A sheet with vexcode for nodes wich arent written in vex.

i.e. Attrib transfer:

-assigning the value to existent variables.

-an if then for non existent variables etc.

-creating non existent variables

blahblah....

that would be good.

-

Share this post


Link to post
Share on other sites

attrib transfer in vex is pretty easy actually.

You just need an attribwrangle and type @P = v@opinput1_P; (if you want to transfer P for example)

this transfers the P of input1 to the P of input0

This is because by default attribwrangle matches attributes by id (you can see/change that in bindings tab)

Edited by 3dome
edit

Share this post


Link to post
Share on other sites

Great ! I didn't know that you can transfert by id.

But is there a way to do it like attrib transfert by distance without the cost of using a point cloud ?

If you compare the cost of attrib transfert versus a pcopen in wrangle, there is a huge performance difference.

 

Share this post


Link to post
Share on other sites

another way to copy attributes from another input is to use the "findattribval" function

it returns the point number of the given input if it founds it or -1 if it doesn't find.

int match = findattribval(1, "point", "name", s@name);

if(match!=-1) @P = point(1, "P", match);

 

Edited by holycause

Share this post


Link to post
Share on other sites

You could use xyzdist and primuv, but I think that may be slower than pcopen and attrib transfer! :D

 

int prim = @primnum;
vector uv = @uv;
float maxdist = ch("maxdist");
xyzdist(1, @P, prim, uv, maxdist);

@Cd = primuv(1, "Cd", prim, uv);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×