Short guide to interactive BPY code completion and debugging with Eclipse

Hi, I have created a page-and-a-half’s worth of instructions for setting up eclipse to be an interactive debugger and code completion editor (IDE) for python in Blender here:

Note most of this needs to be attributed to Witold Jaworski and his ebook ‘Programming Add-Ons for Blender 2.5’:

http://airplanes3d.net/pydev-000_e.xml

That ebook is fantastic and a recommended read for any bpy developer (especially those starting out), however in my case I just wanted to debug my script that was well underway - it was far too heavy for just firing up an IDE which is what I wanted to do. Other guides I found simply didn’t work because they assumed you already had half the parts, which I didn’t.

If any of my guide doesn’t make sense or you get any strangeness, please refer to Witold’s guide which has background, screenshots and trouble-shooting information. Read it anyway in your own time but start debugging today.

Coders can ignore and maybe even chuckle and scoff at the next bit :slight_smile: and new coders might find some advice worth reading as an insight for using IDE’s.


I know a lot of coders tend to direct new coders to dump objects to print to trace code. We all know that real coders use notepad, a command prompt and keyboards that contain only a 0 key and a 1 key right? That last part aside, while object printing (no, not 3D printing, print(foo_bar)) works, and so does a crowbar as opposed to using a jackhammer, one can be somewhat more efficient than the other. For small code blocks this means little. As your code begins to instantiate objects, branch, include loops, inner loops and calls off to methods that contain same, your prints work but become more and more laborious to maintain, start to output more and more junk output to sort through, increase your odds of skipping a branch, and require an exponential necessity to re-run in order to shift print blocks to try to narrow down problems. In other words the debugging workload grows and so does the cloudiness over where you’re at.

Believe me, when I need to sit with a coder who is using a notepad-like editor and starts on the trail of dumping object data to trace code it gets infuriatingly tedious to watch in the way watching somebody paint an entire wall a single colour with a tiny artist’s brush is, while an unwrapped roller kit sits untouched on the bench behind them.

Likewise, code completion is a brilliant time saver and at the same time an API discovery tool that saves you having to move between multiple windows in order to seek out API information. Documenting your own code properly along the way automatically gives you this slick methodology of instantiating your own objects, referencing their properties and calling their methods all with code completion and popup hints. You don’t need to remember it all or keep referring back to the object.