July 8, 2020
Prefixed is an asset naming enforcer that can be used to keep your projects neat and organized. To get started, follow these steps.
The first thing we need to do is make sure that we have enabled the Prefixed plugin for our project. Open up the Editor, find the menu in the top left corner, and navigate to Edit->Plugins. You can find Prefixed in the Installed->Editor category. Click the checkbox to enable the plugin and restart the Editor.
Next, we need to install our asset naming rules. Naming rules are read from all files with the
.prefix file extension. This file can be placed in:
Files will be read in the order listed above, and newer rules will override older rules. You can use as many or as few
.prefix files as you want, but it is a good idea to place a
Core.prefix file in your Engine config directory that handles standard Engine classes (Characters, Actors, etc.). This file will apply to all projects using the same Engine and can help ensure consistency. Then you can add additional files to plugins or your project to override Engine-wide rules or to add new plugin or project-specific rules.
A minimal rule set is packed into the Prefixed plugin's Resources folder. However, for a more comprehensive set of rules, check out the Unrealistic Style Guide.
v1.1.0, you can simply navigate to the Tools menu in the main viewport and select the Install Default Rules action. This action will download the latest rule set recommended by the Unrealistic Style Guide and install it to your Engine's Config folder.
Restart the Editor.
We are now ready to lint. Simply select the folders or assets that you would like to lint, right click, and click the
Run Linter option. A dialog will pop up which will allow you to see the proposed rename, make any corrections, and apply the changes.
If you get an error when selecting the
Run Lintercommand, it's possible that your asset naming rules were loaded incorrectly. Check out this article to learn more about proper rule formatting and how to add your own rules.
And voila - you now have consistently named assets! Happy linting!