Is there any way to modify the variable name processing to allow for different naming conventions?

Let’s say that you want to name member variables with a prefix, like mName or m_Name. By default, Unreal will convert both of these to “M Name”. Is there any way (short of modifying engine code) to change the way this works so that it will still end up showing it as “Name”?

To be clear, I’m talking about universal solutions i.e. using the DisplayName meta tag is not the sort of thing I’m looking for.

There is not, that I’m aware of, outside of the two solutions you came up with. Well, there might be a third possible solution, writing a plugin that overrides and/or extends the engine’s handling of that, however I don’t have the slightest idea where the code would be that handles that, to see if it’s something that could be done.

For what it’s worth, prefixing things like that is generally considered a bad practice, and I think the main reason Unreal continues to do it with booleans, is because of how easy it is in C++ to get bools and ints confused with each other.

I definitely disagree on that being a bad practice. Not sure what companies you’ve worked for but Unreal is the first engine I’ve worked on that doesn’t use prefixes to denote scope. The fact that literally everything in the engine is both PascalCase and has no prefix is wild to me.

I was frustrated that there was nowhere online with an answer to this so I decided to find where Unreal creates its display names. It already removes “b” prefixes on bools in Engine\Source\Runtime\Core\Private\UObject\UnrealNames.cpp Line 2504, so you can just modify this code so that it ignores other prefixes like “m”. This does mean changing Engine code, so it will require that you build from Source: Downloading Unreal Engine Source Code | Unreal Engine 5.4 Documentation | Epic Developer Community

Here’s my modified code:

        // Skip the character if using any combination of m, b and _ before the first Uppercase character
		// For example, a bool could be m_bIsOn, so the editor should show IsOn
		if (OutDisplayName.Len() == 0 && (bIsBool && ch == 'b' || ch == 'm' || bIsUnderscore))
		{
			continue;
		}