How to use Eclipse+PyDev w/ Panda3D.

To address most “Unresolved Import” IDE errors in the IDE I did the following–

  1. Went to Windows | Preferences | PyDev | Interpreter - Python | Libraries
  2. Added my Panda root directory to the libraries.

The tutorials use quite a few builtin variables, which are very similar to global variables. To prevent those from throwing errors–

  1. Went to Windows | Preferences | PyDev | Editor | Code Analysis
  2. Added the following variables as undefined–

base, render2d, aspect2d, pixel2d, render, hidden, camera, loader, taskMgr, jobMgr, eventMgr, messenger, bboard, run, ostream, directNotify, giveNotify, globalClock, vfs, cpMgr, cvMgr, pandaSystem, wantUberdog

Finally, as you go through even the Tutorial you will encounter a case that’s not so easy to solve–

from panda3d.core import Point3
Unresolved import: Point3

The solution is here–

[Panda3D Eclipse / Pydev setup)

Note: It is important to note that the code solution has a bug. You will need to find the line–

   f.write('%sclass %s:\n%s    def __init__(self):\n%s        pass\n' % (baseIndent, t.__name__, baseIndent, baseIndent))

And change it to–

   f.write('%sclass %s:\n%s    def __init__(self):\n%s        pass\n' % (baseIndent, name, baseIndent, baseIndent))

If you run this at the command-line it will create pre-defines for the dynamically linked libraries that you can plug-in under the “Predefined” tab in Eclipse, located in the same place as the “Libraries” tab.

Happy, Happy, Joy, Joy! :slight_smile: