Home » Support » Index of All Documentation » How-Tos » How-Tos for Modeling, Rendering, and Compositing Systems »

Wing IDE is an integrated development environment that can be used to develop, test, and debug Python code written for Source Filmmaker (SFM), a movie-making tool built by Valve using the Source game engine. 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.

Debugging Setup

Wing can debug Python code that's saved in a file, but not code entered in the Script Editor window. As of version 0.9.8.5 (released May 2014), this includes scripts run from the main menu. In all versions, code in imported modules may be debugged.

When debugging Python code running under SFM, the debug process is initiated from outside of Wing IDE, and must connect to the IDE. This is done with wingdbstub, as described in in the Debugging Externally Launched Code section of the manual. Because of how SFM sets up the interpreter, you must set kEmbedded=1 in your copy of wingdbstub.py.

As of May 2014, SFM comes with wingdbstub.py in the site-packages directory in its Python installation. If an older version of SFM is being used or if Wing IDE is installed into a nonstandard directory, copy wingdbstub.py from your Wing IDE install directory to the site-packages directory. The default location of the site-packages directory is:

<STEAM>\steamapps\common\SourceFilmmaker\game\sdktools\python\2.7\win32\Lib\site-packages

Before debugging, click on the bug icon in lower left of Wing's window and make sure that Accept Debug Connections is checked. After that, you should be able to reach breakpoints by causing the scripts to be invoked from SFM.

To start debugging and ensure there's a connection from the SFM script being debugged to Wing, execute the following before any other code executes:

import wingdbstub
wingdbstub.Ensure()

To use the python executable found in the SFM application directory to run Wing's Python Shell tool and to debug standalone Python scripts, enter the full path of the python.exe file in the Python Executable field of the Project Properties dialog.

Related Documents

Wing IDE provides many other options and tools. For more information:

« 4.2. Using Wing IDE with NUKE and NUKEXTable of Contents5. How-Tos for Other Libraries »

Using Wing IDE with Source Filmmaker