Using Wing with Source Filmmaker

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

Wing is a Python IDE 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. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional programmers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

To get started using Wing, refer to the tutorial in the Help menu in Wing or the 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 (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, 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

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


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

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 provides many other options and tools. For more information: