Wing IDE is an integrated development environment that can be used to develop, test, and debug Python code written for Blender, an open source 3D content creation system. Wing provides auto-completion, call tips, a powerful debugger, and many other features that help you write, navigate, and understand Python code.
For more information on Wing IDE see the product overview. If you do not already have Wing IDE installed, download a free trial now.
To get started using Wing, refer to the tutorial in the Help menu in Wing and/or the Wing IDE Quickstart Guide.
Blender's loads Python scripts in a way that makes them difficult to debug in a Python debugger. The following stub file can be used to work around these problems:
import os import sys # MODIFY THESE: winghome = r'c:\Program Files\Wing IDE 2.1' scriptfile = r'c:\src\test\blender.py' os.environ['WINGHOME'] = winghome if winghome not in sys.path: sys.path.append(winghome) #os.environ['WINGDB_LOGFILE'] = r'c:\src\blender-debug.log' import wingdbstub wingdbstub.debugger.StartDebug() def runfile(filename): execfile(filename) runfile(scriptfile)
To use this script:
Once the above is done you can debug your script by executing this blenderstub file in blender. This is done using File -> Run Python Script from the bottom menu or by the Alt-P key, though Alt-P seems to be sensitive to how the focus is set.
Note that you will need to turn on listening for externally initiated debug connections in Wing, which is most easily done by clicking on the bug icon in the lower left of the main window and selecting Accept Debug Connections in the popup menu that appears.