 Howdy guys, IndiePixel here. And in this video, I'm gonna talk about how to create an HDA for the Houdini engine for Unreal 5 here that will automatically place a volume actor around a selected set of objects and it'll orient it correctly. So let me demonstrate how this will work and the HDA that we're gonna create in this video. So I just instance the HDA into the level and let's go take a look at the details panel over here and we're gonna go over into this particular area here and I'm gonna go and say start selection and this will allow me to select a certain amount of actors here. And then I can say use current selection and you'll notice that it produces a trigger volume here. So if I were to select this guy and go into brush editing mode, you can see we have this trigger volume that's been oriented correctly around those selections and we can update the selection to whatever actors we want. So if I say start selection, let's add a couple more of these guys. So use current selection. You can see now that the volume itself has updated and reoriented to the new selection. So let's take a look at how we build this inside of Udini with Udini Engine. First thing to do is go and create a geometry node. So let's drop down in geometry node and I'm gonna call this get objects and then I'm gonna select it, do a shift C. That'll create a subnet around it because I wanna control my inputs and my outputs separately. So I'm gonna call this IP add volumes to selected like so. Then I'm gonna right click on this guy, say create digital asset and I'm gonna put in my namespace and my version number like so and then just clean up the label and then we need to save it to an actual location. So I'm gonna put this into my current Unreal project here. So we're gonna go to Unreal projects. We're gonna go to volume actors, content, HDA and we're gonna save it right in my HDA folder. So hit accept. That'll bring up the type properties. I'm just gonna put a one point own for the version number and then go and hide on my default UI that comes with the HDA. So with that hit accept and dive into my HDA and then set up an object merge node here and we'll call this get objects as well. And I wanna actually import the transform information from all the assigned objects that we assigned to this particular HDA. So then I'm gonna drop down a null node and this will just serve as an easy way to get the output from this object merge node. So we'll say out objects like so. All right, with that done we need to go to the type properties and we need to promote this object one parameter. So to do that, I tend to use the alt middle mouse click and then I wanna give this a proper name and a proper label. And now inside of the Houdini engine for Unreal if you were to put outliner in front of the name of this particular parameter it will automatically default the object input to the outliner selection type. So just keep that in mind. So I'm gonna call this outliner objects and then outliner objects like so. There we go. Hit apply and accept. That's pretty much all we need to do right now. So I'm gonna hit save node. I'm gonna go to my Unreal project here and let's go. I'm gonna show Explorer here. We're gonna go and find that HDA that I just made. So IP add volumes to selected. I'm gonna drag and drop that into my content browser here and hit save. And then I'm going to right click on it and say instantiate at the origin like so. There we go. Also make sure that your Houdini engine has started and stuff like that. It'll auto start if you, if it's not already started when you instantiate the HDA. All right. So what we can do now is go and assign. Let me actually get rid of the previous example here. So what we can do is we can go and assign objects to this input. So you notice that it's actually automatically converted over to the world outliner input. There's a lot of different types of inputs here. So by putting that outliner in front of the parameter name, it defaults to that, which is great. So I'm gonna hit the start selection. You'll notice that the button switches over to use current selection, which means that it's waiting for a selection. So I'm gonna select a bunch of objects and then come back to the details panel and hit the use current selection button. And what happens is they get assigned into that SOP input here. So now I have both those containers in here. The cool thing about this is I can do a control alt and O and this will automatically open up my Unreal scene but inside of Houdini so I can continue to work on my HDA. All right. So once you're inside of Houdini here, I'm gonna go to my desktop. I usually hit L to space out all my nodes. All right. And then I go and find the HDA that's currently active in my Unreal scene. I turn everything off. So just by selecting it and hitting the blue flag. And then I come in here, allow editing of contents. And if I were to hit F with my cursor over the scene view here, you can see I have the imported objects. And you'll notice that if I go to wireframe by hitting W on the keyboard, I'm getting a really interesting topology. That is not the topology of the actual asset. These are dense polys, but I have Nanite turned on. And so this is the result that Unreal is sent over to Houdini for the Houdini engine to process. This will work just fine for this particular HDA. So I'm gonna drop down a geometry node here. And we're gonna call this add volumes like so. I'm gonna turn off this display flag on the get objects there because we don't need to output that particular mesh. I really just wanna convert this into a volume. So I'm gonna do an object merge node. I'm gonna call this get objects. I'm gonna turn off the transform because we've already imported the transform information. And I wanna get the objects from that get objects geometry node like so. So now it's imported into this geometry node. So we grabbed it from here and just imported it into here. Cool, so with that done, all I need to do is put a bound node around this. Let's do that, it's real easy. But the more important thing that we wanna do is we wanna constantly orient this to the objects shape. So we need to turn on this oriented bounding box. You'll see that it's oriented correctly, pretty cool. Now, how do we get this over into Unreal? How do we get this particular shape? Because currently we have no way of converting this over to like an instance of an actor. And so to do that, we use the extract transform node. And we need to drop down a box. So if I drop down a box and we just keep it at a size of one and one and one, what'll happen is this box will then get transformed, translated, rotated and scaled, or transformed over to this particular box, all right? So I'm gonna pump this guy into the first input, the bounds into the second input. And you'll notice that all I'm left with is a point. But this point is very important here because we can instance a particular actor onto this. The other cool thing about this is it comes with the orient attribute, gives us a pivot. And you can go into the extract transform node and change this over to a translation, rotation and non-uniform scale, which is really useful for volumes because they aren't always just a perfect cube. So now you get the scale values. So in order for this to work, where this actually produce a volume inside of the Houdini engine for Unreal, all we need to do is drop down a wrangle node, we'll call this unreal adders for attributes. And we need to assign the s at unreal instance attribute with some volume. So inside of unreal over here, if you go to the create tab, go to volumes, these are all the volumes that you can create. And so I'm gonna create a trigger volume. And all you need to do is just copy the name and then paste it into that unreal instance attribute in Houdini with no spaces. So let's do that now. All right, so let's go and turn this guy on. I'm gonna type in trigger volume, semi colon, do a control enter to commit the code. And then I found also that we need to basically cut our scale in half. So I just do V at scale times equals 0.5, like so. There we go. I'm gonna right click on my HDA, say save node. I'm gonna go back into unreal and I'm gonna hit rebuild all instances on my HDA in the content browser. And with that, you now have a volume. How cool is that? Very, very cool. All right, and so that's basically what I wanted to show. This scene is all set up with Nanite and stuff like that. And it is just cool to turn this on because it is a cool view. But you can see that Nanite is working. Each one of these shipping containers is around 200,000 polys, so Nanite is a beast. All right, so hopefully you guys found that useful. Let me turn off the display here. But that is how you create oriented volumes with Houdini Engine for Unreal 5. Thanks so much.