 Hi to guys, IndiePixel here. And what I wanted to talk about in this particular video is points and lines inside of Vex for Houdini 16. Okay, so what you see here is actually not being created by the line node. If we were to jump into this particular node right here, it's all being done with this particular attribute wrangle node. And so what I want to do was just walk through how that is done because it's actually quite powerful. You can create your own nodes this way. So I'm going to create a new geometry node, delete the file node, and I'm going to create a new attribute wrangle node here. Okay. And what I want to do is I want to run over detail. I just want to run this once, right? It's kind of like running a function in like C sharp, you just run it once, you know what I mean? And we're not going to run it over every point. Because what I want to do is I actually want to create my own line. And let me turn off these display of the other object there. So what I want to do is I want to create a new int that's called point count. Okay. And this particular point count is going to hold a property or a parameter that we can create on this particular node. So if I just type in this CHI, what's going to happen is when I click this button over here, it's going to create a new parameter on this particular wrangle node. And so what I'm going to do is call this point underscore count. It doesn't like spaces. So I always put the underscore there. Okay. So the next thing I want to do is say int points and make that an array. So that array is going to hold all the points that we create. It's going to hold their IDs basically for the line that we create. Okay. So you can see here, I've already clicked outside of the node itself and everything's cool. There's no errors or anything like that. So I'm going to hit this button right over here. And that's going to create this point count slider for me. And what's happening is it's constantly feeding this value back into this particular function. And because we're only running it once, right in detail mode, we're going to eventually be able to create a line. So now that we have this array and this point count variable, what we want to do is we want to say resize the points array to the point count value. And what that does is it literally initializes this particular array. So it says there are going to be, in this case, with the slider at seven, there will be seven points or seven slots inside of this array over here. Okay. If I remove this down, we get three slots in this array. So what we can do now is we can say for int i equals zero and i is less than the point count. Okay. We'll say i plus plus. So iterate. Awesome. So for each point in our array, we want to actually increment their position. And in this case, I'm just going to do something simple. So it's just going to increment and y by the i value. Okay. So what I'm going to do is say vector ker-pause for current position. Okay. Equals a set of zero i and zero. So every single time we loop through this particular for loop, we're going to set this to the current value of i, which means in this case, with the slider set to three, we're going to start at zero. Then we're going to go up one unit to one, up another unit to two and stop because it's a zero-based index. So it's one, two, three. Okay. So we'll get three points and two primitives. One more done with this. Okay. So with that all set up, all we need to do now is create our points. So what we're going to do is capture the current point ID. So we're going to say ker-point ID equals the add point function. So it's add point with the lower case. Okay. Add point. And we're going to say geo-self, which just means that we are adding geometry onto this particular node. So whichever node that we're on, we're just adding it to this node. So geo-self is this node. And we're going to say ker-pause because that's the position that we want it to be at. All right. So then finally, we're going to say points i. So that particular index equals the ker-point ID. And now we have three points. You'll notice that when we finished, when we finished that statement and I clicked outside of the code editor, we have three points and they all have their own IDs. So zero, one, two. And it works with the slider. So I can go up and down like so. Perfect. So at this point, what we can do is we can easily just say add prim like that. Okay. And say geo-self. So we basically want the primitive to be added to this current node. We want to make a polyline. All right. Because we want just want to connect the points with the line. And we want to pass in all those points that we stored inside of this points array. And if I click outside, we now have a line with points, literally just like the line node. Now, obviously, this is a very rudimentary version of that line node. But you can start to see how, with just a little bit of math, a little bit of programming over here in VEX, you can start to create your own nodes that do your own particular types of functions. Let's say I want a line that automatically has bending functionality. All right. This would be the basis for that particular node. Okay. So let's say we want to grab every primitive or we want to create a primitive between every segment of points right here. So what we do, let's just comment this out like so. Okay. So now we're not creating the primitive, but we still have the points. What I would want to do is say four and i equals zero. All right. i is less than the point count minus one i plus plus. Okay. So what we're going to do is we're going to say, let's start at point zero and let's find the point further and let's make a polyline. Now let's go to point one, find the point further, which is point two and create a polyline. And we want to do that all the way until we get to point five, because if we get to point six, we don't want to wrap around. All right. So basically now what we can do is we can say add prim, geo self. The type is going to be a polyline. And we need to feed it two points. And you can find that information out. If you go to the help and the ad prim has a bunch of overrides, meaning they have a bunch of different versions of the ad prim function. In this case, we are going to be using the third method right here. So we're going to add a point and another point and it'll connect those two. So let's hide that. Perfect. So what I want to do is I want to add the points. I, because I want that particular point, that point ID. Okay. In this case, it'll be zero because if we think about this from starting from zero, the current point will be zero. But then I also want the points I plus one, like so. And if we do that, you'll notice that we get zero, one, two, three, four and five. We have a primitive between each of those particular points. So we split that whole thing up. And with just a little bit of code. If you wanted to do this with the line, let's say I had this line right here. Okay. And I want to go increase the length. Let's just reduce the amount of points here so we can get a better idea. I'd have to go and group all these guys. So I have to group by range first. All right. And I have to do by points. And I want to do a dollar OS like so. And we'll just call this the middle points. And what I want to do is just pull these guys up here. So I just get the middle points, not the ends. And what I'd have to do at this point is use a poly cut node. Okay. And we have to put in the cut points. So we will put in those middle points. And in this case, we'll just cut. And in three nodes, I now have a primitive per section or per segment of this line. Whereas with just a tiny bit of code, all right, just that in one node, we're able to cut it up. So again, it all depends on how you want to work. But I just really wanted to show in this particular quick tip how to go about creating your own polylines. All right. And it doesn't have to be in the y direction. The direction is being determined by this particular line right here. This is just connecting the individual segments. And this is creating the point. So all you need to do is just augment what vector you're actually passing in. And you could literally recreate this whole line. Okay. So again, there's multiple ways to do things in Houdini. And I really just wanted to show how to go about that. Thanks so much.