Not always a widget
While adding a widget utility that has an interface is really good for new users or tools that need repeatable functions with differing values on each run, it is a huge development time consumption to create and manage the widgets interface and appearance. To skip all that you can make an "Action Utility" which on the backend works exactly like a widget based utility however the user can run it simply by right clicking with the mouse and selecting the the action they want to run out of the ones that appear on screen. The downside of this is while you can enable user input it is much more limiting then how widgets work and not as friendly to use.
Asset or Actor action utility?
This is a very important distinction to make as the action option will only show up in the relevant context menu and choosing the wrong kind of utility base class will determine when your function option is shown.
An Asset action utility will appear in the context menu after a user has right clicked an asset file within the content browser. These kinds of tools can see what is inside the current projects content folders and can change data, parameters, file paths & file names all with a right click. An instance where you want to use this functionality is re-naming all your static mesh class assets to have a pre-determined naming convention helping your project stay organised.
On the other hand an Actor action utility won't show up when an asset in the content browser is selected but instead will show up when you right click on an actor within the level viewport (or outliner panel). The Asset action utility will change asset parameters throughout the whole project and across every single instance that asset is used but this is not always the best practice and can easily break/corrupt the project or level if misused (also dependant on the level of changes made), to stop an unaware user from making project wide changes a tool programmer would want to choose an Actor class based utility as this will only change the parameters of the instance that is currently selected by the user. Since it is only the instance of the asset that is edited by tools function code level designers can have the freedom to use advanced tools really quickly and easily without having the programmers worrying about assets getting edited incorrectly and seriously damaging the project.
For the next few tools I will be choosing to use Asset based action utilities as I'm going to continue forward by learning how to manage the entire project and all it's content.
Making Folders
I had an idea for an easy to implement task where you can right click in a new empty unreal engine project and instantly create a series of both folders and sub-folders for assets to be imported into later, making the project organised from the start.
To my surprise there are few tutorials for making Editor Utilities and Unreal Engine Tools unless you are creating C++ scripts (which can do the same as Editor Utilities) that can setup an entire custom version of Unreal Engine for you. The information on the C++ front isn't always for Unreal or game development and is more from Learning C++ resources and C++ for program development, which while really good learning resources are not what I'm looking for with this project and learning how to script Editor Utilities.
Below is an example of how I used trial and error to figure out which node I was looking for to create a folder within the content browser. At first I began by searching for a "Folder" node but the node which I needed is the "Make Directory" and this process (like all trial & error) can take far too long if the programmer is unsure of what it is EXACTLY that they are looking for, which as I am just learning how to call editor functions is a big roadblock for me. I did manage to find the nodes "Get Asset Registry", "Get Current Browser Path" and found out about the "Virtual" vs "Internal Path" nodes, all of which would prove very useful in future.
To overcome this roadblock I began reading the Epic Games Unreal Engine Documentation as a means of both checking that the task I was looking to accomplish was actually a function I could call from Unreal Engine and checking the terminology.
Once I had the "Make Directory" node the only thing I needed was to know how Unreal would handle the entire project changing its top level directory (which is on my USB so the drive letter changes all the time as it swaps PC). Rather then entering the projects top level directory path of "E:\Uni Files\Unreal Engine\UE5.3\EditTools\Content" (Which btw the "\content" folder is where unreal engine saves any imported or created assets), I found that "/Game" works similarly to the "\content" folder as in Unreal Engine will always remember its location within the project as long as you do not restructure your entire project outside of unreal using a file browser. This meant that if I entered "/Game/Blueprints" my tool would create a folder named "Blueprints" inside the "\EditTools\content" resulting in the end path being "\EditTools\content\Blueprints" no matter where the main project directory was stored or which computer the tool was used on.
The rest of the code in this tool is some QOL additions as I do not want the tool to create a 2nd folder named "Blueprints1" or erase all the contents of the 1st "Blueprints" folder and replacing it with an empty one of the exact same name.
You can see the final blueprint below or by following this url "blueprintUE.com/EditTools_CreateFolders".
Continuing Forward
Now that the folders will be made I decided to add a tool that prints a readout of all the assets contained within the currently open directory of the content browser. The idea behind this tool is that a programmer can open the project then navigate to a folder containing another staff members work and immediately get a report as to how many individual asset have been dumped in this directory. now with that information the programmer can begin organising the projects file structure with an idea of what sections need prioritising. This is only relevant if none of the other staff members obey the naming conventions and folder structure when importing their work or editing their respective areas of work.
This is the first instance where I have seen the "Show Message Dialogue" node which is really helpful as a way of giving feedback to the user for a non-widget based tool.
Actually adding and changing assets on mass
With a start in managing the content browser it's time to finally add some assets to test out my tools code works, so I imported some static mesh assets I had made for a previous project then ran my Asset Actions and added another tool which creates new LOD stages for any static mesh asset it finds that doesn't already have any LOD's.
URL to BlueprintUE.com/EditTools_SetNewLOD's




Comments
Post a Comment