Jump to content

attribute wrangle and -run over- parameter


Recommended Posts

I am trying to understand how attribute wrangle works.

For instance, in the Connect Adjacent Pieces SOP, I found an attribute wrangle node running over "Primitives".

This is the script :

 

vector p1 = point(0, "P", @ptnum);
int vertex2 = vertexindex(0, @primnum, 1);
vector p2 = point(0, "P", vertexpoint(0, vertex2));

setprimattrib(0, "length", @primnum, distance(p1, p2));

The meaning of the script is clear.

I understand @primnum must contain the number of the primitive currently being calculated (since the node is running over all the primitives). But I have troubles understanding how @ptnum can contain the point number ! I mean, this script shouldn't work ! :)

 

Does anyone care to enlighten me ?

 

 

 

Link to comment
Share on other sites

if you run over primitives, @ptnum contain lowest point number of all points belonging to the current primitive

in case of the script it is first point of the each constraint polyline

 

(if you run over points @primnum contains lowest primitive number of primitives belonging to the current point)

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...