Code complete in Pydev and Eclipse with Panda3D


Greetings everyone

It’s been a while since I’ve touched Panda3D so I’m starting again to get the grip of it. Lets see if I can get up to it again :stuck_out_tongue:

Not sure if this has been posted already… but there it goes anyway…

Ok I’ve been tinkering with Pydev searching for a way to enable code completition, and I’ve found this might work for many people and prove to be useful for learning panda:

  1. Go to Window -> Preferences
  2. Head to Pydev -> Interpreter - Python

I suppose you added the ppython installation from panda, (not sure if it works with other python installations… but with the ppython, python, or wpython from panda works fine)

  1. In the python path window, you have to add the main Panda3D installation folder (e.g c:\panda.1.x.x) and the bin diretory (e.g c:\panda.1.x.x\bin for example) as new folders, in addition to the other panda folders

  2. Go to the “forced builtin libs” window, click on “New…” and add the keyword direct, repeat the process but instead add the pandac keyword.

  3. Click on Apply and then and after the code analysis click Ok… as far as I know this enables auto complete with panda…

However at this point it won’t recognize all panda libraries, (no idea why, it will recognize some like gui or fsm), but you can fix it if you copy all the folders that are in your direct\scr folder (e.g c:\panda.1.x.x.\direct\src) to the direct folder (c:\panda.1.x.x\direct)

That’s too bad :frowning: since I did not want to hack the panda installation to make it work… maybe its something I am not doing?

What works:

  • Code completion from pandac modules and direct modules are correctly identified, included inherited ones like DirectObject (Ctrl-Space for code completition)

*The code completition shows documentation with parameters and reutrn value, if any

*Pydev will import libraries if not found (Ctrl-1 to fix the error will show Import…“specific library”)

What doesn’t work:

  • Certain variables like base, render and render2d can’t be identified

  • Some imports wont be recognized (Examples like DirectObject and Actor) when instantiated (Example: act = Actor.Actor() and DirectObject.DirectObject) BUT after that their variables will detect their methods without trouble (act will recognize code completition for example).
    You can export directly the modules apparently, but I recommend to use the panda standard


*Importing import direct.directbase.DirectStart with code completition will make a panda instance to run

*It takes time to search all libraries and Eclipse freezes for like 6 seconds roughly the frs time it looks for something (like Actor class methods)

And done and done, this was what I wanted to say for now :stuck_out_tongue:

Couldn’t believe it was so simple (well not that simple)… the forced built ins in Pydev exist because many modules (not just panda) have their imports generated at runtime… quoting from the Pydev FAQ

However I might have done something else that I did not notice, so I you can’t auto complete yet please tell me, so I’ll keep searching if I have done something else…

Later everyone,

PD: It seems this is pretty standard for many python modules (like wxPython) for this to happen… so I suppose there might be an equivalent in other Python editors?

Italo F. Capasso B.
AKA “Edwood Grant”

Panda3D Eclipse / Pydev setup
New Guy Here - Questions Inside
Pyscripter Vs. Eclipse

I’m wondering, can you get completion on all functions/methods return value ?


Hmmm no code complete for function/method return value I’m afraid…

As far as I know only the functions/methods that are documented will tell you information about the method, including return value (if it is documented) otherwise it wont show anything (sometimes it shows method parameters withouth documentation, but sometimes not. Maybe something related to the documentation itself and not code completing issues?)


one possible it creating a facke python library thats generated form that is avaliable at run time. This fake lib is only used for code completion though.


If this topic is not forgotten…
So how can I create a faked python library?



Tried your instructions on MacOSX but it did not work. PyDev isn’t even recognizing the pandac modules imports…

Any other ideas on how to get auto-completion?