Debugging Maya with the Wing Python IDE has been one of the greatest breakthroughs in Maya scripting/programming development in recent memory.
I first heard about this possibility from WarpCat’s blog:
My latest project requires some MotionBuilder scripting again and now that I am used to scripting like a pro w/ a real IDE and debugging, I was desperate to get Wing to connect to my MotionBuilder python process.
It turns out to be rather simple
- Put this file into one of your MotionBuilder python paths: wingdbstub.py
- Then type ‘import wingdbstub’ in your MoBu python console.
- Set a breakpoint in your code loaded into Wing
- Run your script from MotionBuilder
Voila! Wing should grab it.
*Added bonus. For autocomplete in Eclipse, you can add this line:
if False: from pyfbsdk_gen_doc import *
It turns out that there is a stub file for the pyfbsdk docs in pyfbsdk_gen_doc.py. So if you import this file, Eclipse (and other IDE’s, I presume) will reference this file for the docs for all classes and methods. The problem is that if you actually important this file, it will overwrite the functionality of the commands and they will not do anything. So by putting the ‘if False’ condition in there, when you run any of these scripts, it will not actually import the code. But Eclipse does not know any better and will still check this file for doc reference.
This sounds awesome – thanks for posting!
So I followed your steps and.. well nothing 🙂 The code runs fine in MoBU, but wing does not seem to notice and evaluation is not halted at breakpoints.
Do you know if there are any other steps I need to follow or if additional setup required?
Enabling passive listening in Wing preferences and setting kEmbedded = 1 in wingdbstub.py was the key to making this work. All this stuff is outlined in the Maya/Wing debug post: http://www.jason-parks.com/artoftech/?p=76
Not sure if I need to enabel ‘Kill Externally Launched’ – but it seems to work both with and without.
Thanks again – this should be super helpful!