 Howdy guys, IndiePixel here, and I really appreciate everyone's support so far. Thanks for all the comments and stuff like that. Really, it's fun to talk to the community and stuff like that. I am back to all my YouTube stuff. I know I took quite a little break there for the beginning of this year, but I am back and got all the client work stuff out of the way and GDC. So what are we going to do in this particular video? So we're going to go over two things really. We're going to go over how to do grouping with Vex over here. All right, so we're going to learn how to utilize the setPrem group and point group. So we're going to do that and then we're going to take a look at how to get the sizes of objects and then use that information to create masks that then you can actually go and group things with, right? So I do this a lot when I'm modeling. I need ways to generate masks, you know, based off of things like proximity or height, you know, size. So it comes in handy. So I just wanted to go over the core concept of how these things work. So let's jump out of here and I'm going to drop down a new geometry node so we can do this together here. All right, so I'm going to jump inside here and just hide the other objects. All right, so I do have my geometry spreadsheet open. It'll be really useful for you to have that open. So let's just cover that. So I'm going to go and split the pane top and bottom and then just select geometry spreadsheet. All right, I'm going to get rid of this file node here. And the first thing I want to do is just drop down a grid. All right, so we just have some geometry to work with. And what we're going to do is we're going to cover the grouping methods that are available to us inside of VEX. So let's drop down an attribute wrangle node here. All right, and we're going to start with point grouping. Because once you understand this, the rest are pretty much the same. But we're going to take a look at points and primes in this particular lesson. All right, so the first thing that we want to do is just understand how the actual code works. Okay, so currently we're set to run over points. So we're going to run whatever code is in here for every single point. And what I want to do is I want to start typing out the method. Now the method is set point group when you're working with points. Okay, so let's take a look at the help information. And let's see what we get. Just so we can get used to using the help as well. All right, so set point group. What we want to do is we want to provide it some geometry. All right. So it's either using the input zero. So use zero for that, or you just say geo self. All right. And then we give it a name for the group. Now if the group doesn't actually exist, already it'll just create it for you. The point number that we want to put into that group and an integer value. Now this value really is just a zero or one. It says if it's one, then I am in the group. If it's zero, then I'm not in the group. And then finally a string for the mode. And the two modes are set and toggle. So we're going to cover all that stuff here. So let's let's get going. And let's say I want a group point. Let me actually comment this out here. So I can see. All right. So my point numbers turn on and I'm just going to group, let's say point five. So if you want to explicitly set a group, you would say zero for the the input that you want to pull the geometry from, right? Or you do geo self, right? Obviously, I just like typing the input number because it's a lot less to type. And then we want to give it a name. So I'm just going to call this the P group for point group. And then we want to give it a point number. So in this case, I'm setting it explicitly. So I'm going to say point five. And I want to say you are in the group. And then we set it so that it sets that value. And you can see that point five is now inside of that group. So we have this point group. And it is picked up point five. And if we were to go and actually visualize that, we can visualize that with our, our display group and attribute list utility. And we set it to points. And you can see that we have point five in that group. And you can also change the color over here. Double click this guy. There we go. So you can see it. Let me switch over to wireframe there. So we got point five in the group. Perfect. All right. So, you know, from here, it's, it's pretty simple. So let's do something and say if the at PT num is less than 10. So let's group all of those guys. So we're going to say set point group from the geo self, we're going to put it into P group. And we're going to give it the at PT num because we need the current number that we're on. And we're going to say one because we want to put all points that are that have the ID less than 10 into this group. And so I'm going to say one for that and then set. There we go. And now we have all those points, zero, three, nine. Pretty cool. So let's say I want to remove something from that particular point group, but I don't want to get rid of the group or anything like that. So let's say I want to remove point seven from this. So what we can do is say set point group again, the geo self and we'll say it from P group. And we'll say at actually want to set it explicitly. So there point seven, we can always set it to zero and that will work as well. So now we don't have point seven in there. We can also toggle it. So you can put toggle in there, and then I'll turn it off. So if I were to have another one here, I was set to toggle, it basically just flips it. And now it's back in. All right, and that's, that's the basics of how the grouping works inside of VEX. It's basically the same for primitives. You'll notice that let's go drop down another wrangle node here, and we'll work with primitives. So you'll notice if I start setting, typing out set, and we do prim group, it's got the same setup. And the code is pretty much exactly the same. Actually, I think it's exactly the same. All right. Yeah. So it works exactly the same. So you have, you know, for vertices, any type of group that you can create in Houdini, you can create that here. So you have set vertex group and set detail group, I believe. Anyways, so let's go and do something like, we'll call this the prim group, like so. And I want to do, let's get rid of our point numbers now and we'll do primitive numbers. Let's say I want to do primitive five inside of there. So we'll say point five, we want to add it to the group and then say set. All right. So then we want to switch our view over here in the geometry spreadsheet over to primitive. And we have primitive five in the group. And if we were to check that in our display, we have primitive five inside of the group as well. And the same goes. You can always toggle it like so. Pretty simple stuff. All right. So that's the basics of grouping right there. So let's move on to the BB box stuff, which is really fun as well. So what I'm going to do is drop down a box. And for this, I'm going to actually set it to a polygon mesh. And I'm going to change these, the resolution of it. So let's display it. And let's go and I'm going to hide the display groups and attributes there. And I'm going to just increase the resolution of this guy. There we go. Okay. So what I want to do is I want to start generating generating masks based off of the size of this particular box. I want to get all the information about this and start to process it so I can generate color masks that I can then use for grouping or attributes or whatever, right? So let's drop down another angle node. Like so. And the first thing we're going to do, let's do something simple. I mean, this is all pretty basic stuff. It's all the core concepts. But let's do something like the min size. So what I'm going to do is say vector min is equal to get BB box min. And for this particular function, we only need to provide it the geometry that we want to work on. So let's take a look at it in the help. So there's the geometry and then there's actually an override that allows us to then throw in a primitive group. So it'll only work on certain primitives. So in this case, I'm just going to use the first override there. Okay. So let's give it the zero input, the first input here, put a semicolon there. All right. So now inside of this vector, we have the minimum information. This is literally exactly like if I were to do something like the BB box, right? So the BB box function where you go and get the dy max or y min, it's all it's exactly like that. So what I want to do is get rid of that transform. We don't need that anywhere. So let's do something like we're going to say the color at CDR is equal to at p dot y divided by the min dot y. Let's see what we get. And we actually get this gradient. Let's initialize the color to something to nothing. There we go. So now we get this gradient based off of the minimum height of this particular object. All right. So what we can do is we can flip that, right? If we get the max now, so we'll say vector max is equal to get BB box max. Give it that geometry. And let's say now we do max y. So we flip it. You could always also get the inverse when you do something like one minus these guys. There you go. Actually extended it, but cool. So then let me get rid of that. Well, actually we can leave it there. That's fine. All right. So let's do something else here. Let me actually switch that over to the green channel as well. So it kind of represents everything. Now I changed my mind. I want to keep the original one that I have. There we go. Cool. Now let's do the max on the x, right? So if we say r is equal to at p dot x divided by, let's say the max x here. There we go. So now we got a gradient going that way. Now the cool thing about this is we can create a full gradient by using a fit function in here. So let's say something like, let's say fit at p dot x. And we're going to fit that between the min x and the max x. And then I'm just going to normalize it. So 0 to 1 like so. And there you go. So now you have a full gradient. All right. And if you need the size information, you can get that as well. So we can say vector two will say size is equal to the get BB box size. And that instead of positional values, you get the overall size of the bounding box of this particular object. So, you know, the full y hide or the full x width or the full z depth. All right. Another cool thing is the center. So we can actually do the some cool stuff with this. So I'm going to say get BB box center. All right. And let's do something like at cd dot b is equal to the distance. Let's do a distance of the current point position to that center itself. And right off the bat, you can see it's kind of working. It's really hard to tell. So if I do a one minus here to flip it like so, it's still relatively difficult to detect. But I'm creating a circle basically. Oh, there you go. You kind of see it now. So what we would need to do is actually multiply the position by some sort of scaler. So we'll say chf. And we don't need those brackets. I don't know why I did that. chf p scalar. And then we need to generate that parameter. So now if I were to increase this, you can see that we're getting a circle in the middle there. All right. And if we were to change where that center is by adding some sort of vector to it, so I could say plus zero, 0.5, zero and Z, I'm just going to move the center up a little bit. We're now starting to get something that you can use some sort of radial selection or something like that. Cool. So that's really what I wanted to show there. You can see that when you start typing and get BB box, there's the whole BB box. So it's a bunch of information, all the information, then the center, the max, min and size. That is that. So you can create some really cool mass that way, really quickly. And let me get rid of the, I want to keep that in the center there. All right. That, well, actually, I had one more thing I wanted to show. So I want to actually multiply these min and maxes by a parameter as well. So we'll say min scalar. And let's just copy this and paste it. So we'll call this the max scalar. Now you can give yourself some control over that ramp. All right. So now we can provide sliders to change the mask or something like that. I don't know. I just like showing all these different little techniques because you basically take all these techniques and you start combining them and creating more complex versions. These are just little components that you put into your entire graph that ends up making you something cool like a bridge or something like that. Anyways, that, my friends, is what I wanted to show. Again, thanks so much for all the support out there. And I'm going to start posting a bunch more videos working on the airplane physics course, working on a procedural prop course too. Obviously, the physics course is taking precedence right now. But anyways, yeah, thanks guys. I'll talk to you in a bit. Bye.