How do you get auto completion and stuff?

I am glad that the cause was found, thanks for your help.
While we are waiting for the update in the 4.22 could you please share a full unreal.py stub so that we can make some use of the autocomplete functions (with all the limitations of the case)?

Sure, you can find a generated version here: unreal_python_4.21.zip - Google Drive

It is worth noting though that it’s only broken when not generating API docs, so you can still run the doc gen commandlet yourself and you’ll get a stub file that’s correct for your project (you can stop it once you see the “…generated: Bla/Bla/Intermediate/PythonStub/unreal.py” line).


YourProject -run=PythonOnlineDocs -IncludeEngine -IncludeProject

Thanks .
We managed to build the stub.
I add a note: the stub is re-generated when you open the editor and when you build C++ code so you have to open the editor first, let it generate the stub, launch the commandlet and save the complete generated stub to prevent it being overwritten and lose the auto-complete in your editor.
I managed to launch the commandlet with this command in an external terminal with the Unreal editor opened:


C:\Program Files\Epic Games\UE_4.21\Engine\Binaries\Win64\UE4Editor-Cmd.exe path_to_/YourProject.uproject -run=PythonOnlineDocs -IncludeEngine -IncludeProject

Do you have a quick tip in how you upped this parsing limit?

In pycharm I had to increase the file size configured limit for indexing to run properly.

2 Likes

old thread, but for anyone still looking… set up in VSCode was pretty straightforward. Pointed the Python ‘Extra Paths’ in the json preferences file to the stub file in the intermediate directory of the ue project. Seems to work fine.

Without this PyCharm doesn’t want to autocomplete unreal module

Pycharm>Help>Edit Custom Properties
Add below code


idea.max.intellisense.filesize=11000 

Reset Pycharm.

https://forums.unrealengine.com/deve…29#post1637629

1 Like

I just couldn’t get autocomplete to work in pycharm and i had no clue why… but i changed the option you folks were talking about to 30000 and that finally got it working…

idea.max.intellisense.filesize=30000

the unreal.py currently has 23K+ lines, so if that filesize option is for number of lines, i guess 11k wasn’t high enough… (i dunno if that number is talking about lines or kilobytes or who knows what, though)

Hi

I followed the process but did not get the unreal imported. There is an error on the atom editor.
Can someone help on what’s wrong here?

Thanks!

For anyone looking to get VSCode and Unreal Python working, I found this helpful 使用VS Code编写UE4 Python脚本_LiSharpsong的博客-CSDN博客

Would anyone know how to set this up fully for Visual Studio 2019? I’ve got the path to the stub file added and I’m getting some auto completion, but not all and I suspect its related to file/memory limits being mentioned here but I cant’ find any options to resolve that in visual studio.

I am quite new to the software and programming in general…

You can do that as discribed at Setting up Autocomplete for Editor Python Scripting in Unreal Engine | Unreal Engine 4.27 Documentation.

Following steps executed on Windows 10 and Unreal 5.1 with installed Python Plugins:

  • Open Edit / Editor Preferences
  • Click Plugins / Python
  • Enable Developer Mode ( This step will generate the Python Stub file )
  • Restart Unreal
  • Find the Python Stub unreal.py file in your Project folder at <YourProjectFolder>\Intermediate\PythonStub
  • In VSCode open User Settings via Ctrl/Cmd + Shift + P
  • Type usj and select Preferences: Open User Settings (JSON)
  • Add the following Entry:
"python.analysis.extraPaths": [
   "F:\\Work\\Unreal\\PixelEarth\\Intermediate\\PythonStub"
]

Exchange F:\\Work\\Unreal\\PixelEarth with your project folder.

Now VSCode understands the unreal Package:

Hey, just wondering:

did you experience any performance related issues, such as vscode being unresponsive sometimes?

I noticed that occasionally it’ll say something like “analyzing 1 file” in the bottom status bar and me hitting enter will not do anything for ~10 seconds.

I’m using both of these in my workspace settings, but removing either does not help with the problem:

“python.analysis.extraPaths”: [
“…\Intermediate\PythonStub”
],
“python.autoComplete.extraPaths”: [
“…\Intermediate\PythonStub”
],