Jump to content

VEX syntax for accessing the other inputs in point wrangle?


magicU

Recommended Posts

Hi all, long time lurker, first time poster..I'm trying to "convert" a Point SOP expression of $NX= $TX2-$TX into Point Wrangle VEX terms where there are 2 inputs to the Point SOP.

I couldn't find any doc references to accessing the other inputs of the Point Wrangle and was hoping someone could point me in the right direction?

 

 

I thought @P1.x-@P.x might work...but to no avail! Even the Ari Danesh H12.5 wrangle tutorial doesn't seem to address multiple inputs...

 

thanks!

Link to comment
Share on other sites

Guest mantragora

In Houdini 14 a good way of figuring out what command is used to access something standard is to put AttributeVOP and look how outputs are called in Geometry Global Parameters VOP, assuming that you have Show Full Input and Ouput Names on VOP Nodes turned OFF in Edit => Prefences => Network Editor, Nodes and Tree. Than you can see how standard variables are called, for example last four outputs are used for accessing inputs coming into AttributeVOP, so just add @ to the name of variable and you have your answer.

Link to comment
Share on other sites

Thanks all, I ended up stumbling across the point() function, but got confused as to why I could skip out passing the "point_number" value mentioned in the docs.
I ended up using this code (Tomas, thanks, I quite like the shorthand of using 1, instead!):

@N=point(@OpInput2, "P", @ptnum)-@P ;

 

The docs function - 

 

point(surface_node, point_number, attribute, index) 

 

Link to comment
Share on other sites

what you just did is not super safe though, because the types you use are ambiguous.

Because @N and @P are hardcoded to be vectors it might work in this case,

but to be safe you may want to add type descriptors,

so your code would become:

 

 v@N = vector(point(@OpInput2, "P", @ptnum))-v@P ;

 

@attrib creates a float attrib by default but you can state what it should be:

 

f@attrib, for floats

i@attrib, for ints

v@attrib, for vectors

s@attrib, for strings

Edited by acey195
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...