XaiJu
Megan Fox
Megan Fox

patreon


How to make a graphical tool in UE4/5

I missed January, so as bonus, I'm doing a kind of dense topic. UNREAL TOOLING.

So there's two (arguably three) ways of doing tooling in Unreal. One is so simple it barely even merits a post.

You just, make a function, right?

And then you tick the "Call In Editor" box over here

And then, uh, <celebratory horn noises>

When you click that button, the function runs. You can control the grouping (currently Default) based on the category you apply to the function here,

Which then, you know,

Easy? OK GOODBYE EVERYONE!

...

Seriously though this is enough! You can do some REALLY fancy tooling just with that. Sometimes all you need is a row of buttons grouped under collapsing headings. BTW, you can do ParentGroup|ChildGroup in those groups to make nested groups, so you could make a "tooling" group and then sort your buttons under there, fancy, easy, nice.

But sometimes you want, you know, a more real UI. Where you can control button layout, add some nice labels, previews, maybe draw a little I dunno map or something, put a little dude in there who says "Hey I notice you were trying to spawn the map," or, whatever! Well, good news, you can do that too!

Editor Scripting Tools

First, go over here: https://ue4resources.com/plugins and get the Editor Scripting Tools plugin.

Now there's, a lot, to this plugin. I'm not gonna walk you through setup, because there's instructions and examples already in the plugin, so get a little familiar with those first, alright? Odds are reasonable you'll just stop reading here, because those will get you going.

If you want a bit more? Ok, you're going to end up with some classes that look something like this:

This is, essentially, the UI of your tool, and the tool itself. Mind the asset colors in this screen. Because it's really easy to accidentally create a SUBCLASS of the Editor Mode Tool Blueprint class, instead of creating an Editor Mode Tool Blueprint ASSET, which means you'll end up with a different color than red, there. I made that mistake, uh. A few times.

To run these tools, you'll pop in here:

And then you'll,

Which will look like,

and ok! What you see here is my brick-stupid UI. This isn't this bad looking because it's all you can do with the tool, it's just because I haven't spent much time with the UI. It can do WAY more.

Even so, the interface is just what you'd use to define the UI for your game. These are just like, regular UI buttons. Looks familiar, right?

The tricky bit, kind of the entire tricky bit, is that when you add the logic, you're going to add it to your Blueprint tool, and that means you'll be calling a function from here into there, which looks like this. The even trickier bit comes in other things you can get that Editor Mode Tool Instance to do for you (not pictured, I'm just using it in a dumb simple way).

But then it's just, pretty basic? It's just the same stuff you'd put in that simple Call In Editor function/button you can do way earlier. All that's different here is that this is behind a potentially much nicer interface, which means you can do WAY more with it. I'm not though, I'm just making a simple button, because it's easier to explain. This is just my actual world-gen tool that I use to populate my world with, in this case, trees!

So that gets you started. It's a very broad topic, but the key takeaway here is that the logic you're doing behind the scenes is ultimately kinda the same, either way you go. The big huge difference is that this fancier route lets you go WAY past this. You can do preview windows, you can actually define render-views and render special cameras and stuff IN your UI this way, all kinds of fancy stuff. That's why you'd do things this way. Read the developer's explanation for the fancy stuff that this can do for you.

If you just want a line of buttons and don't care? Meh, there's easier ways, probably don't bother.

One Last Sort: Blutilities!

What I didn't cover is stand-alone Blutilities (Editor Utility Widgets). You can make something that's kind of like the buttons hidden over in the side components display, BUT, as a stand-alone window, and with a bit more capability in how you design it. It can't be quite as reactive a UI as the fancy Editor Scripting Tools approach, but, Blutilities are also simpler to make, and you can also still specify their UI using the same Editor User Widget Blueprints.

I'll do a secondary post for the $3+ tier explaining those, though they really aren't any more complicated. They're what I'd recommend for most tools, though. The main reason you want to go the fancier route is if you want to future-proof against, you know, maybe someday you DO want a fancy preview window or similar UI that the simpler Blutilities either can't manage, or make much harder.

Stick to using Blutilities for straightforward stuff like your mesh bakers and similar data processing tools that just needs to press a button and then the thing happens/processes a bit/continues and then you get a DING and it says "done!". More complex? Go for the Editor Scripting Tools.

Helpful Extra Plugins

Just go into your Plugins and enable "Editor Scripting Utilities". It's built in, by Epic, has TONS of BP functions you will absolutely want for making tools, and I've no clue why it isn't enabled by default. Trust me, you want it.

How to make a graphical tool in UE4/5

More Creators