Code highlighting and auto-completion in PyCharm and VSCode provide development more efficiency when we develop python editor tools using this way.

However, the unreal-generated stub file becomes larger in every newer unreal engine. In Unreal 5.1, is over 21MB (and its size increases with the number of plug-ins you enable), which causes PyCharm gives a hint of low memory and become much slower.

Changing the memory settings can improve it, but browsing the class and function definitions in a python file over 400,000 lines is not a good experience.

My way is to split the file into several smaller files by class name and then find the required API information in separate files.


I uploaded the python tool for sharding to the GitHub repository. You can find it here.

It does the following two steps.

  1. Copy from Intermediate/PythonStub in your project to TA/TAPython/Python directory
  2. Split with the class names and put the files in the TA/TAPython/Python/unreal directory.

After that, I used them instead of the was a great experience.


Additional benefits:

  • The file size tells you which classes are UE's most essential objects.
  • Quickly find special classes, such as editor libraries and subsystems, which is important for python editor programming.
  • It is convenient to compare the stubs to find what has been modified in different versions of Unreal Engine. G_019_stubs_compare

The remaining issues

We still need to keep the file. And it seems like we can't only use the generated unreal directory for auto-completion, although it has the same content. If you know how to get it work, please share it.

Share On