mrWolf Posted July 18, 2014 Share Posted July 18, 2014 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 ? Quote Link to comment Share on other sites More sharing options...
anim Posted July 18, 2014 Share Posted July 18, 2014 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) Quote Link to comment Share on other sites More sharing options...
mrWolf Posted July 18, 2014 Author Share Posted July 18, 2014 (edited) I'd never have guessed. Thank you Tomas, makes perfect sense now. Edited July 18, 2014 by mrWolf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.