前几天,我自己修改、编译了 Blender (详情请见:知乎专栏)。不过,昨天看 Andrew Price 的教程,想试试 Archimesh 这个建筑插件,却发现运行有些问题。因为官方这个插件在稳定版下运行正常,猜想是我自己编译的 Blender 有些问题,就想自己调试一下看看。
(很奇怪,我只改了 6DOF 鼠标的控制方式,怎么会影响到这个插件……)
我一直用的编辑器是 Visual Studio Code。这个编辑器自在 2015 年三月刚发布的时候我就开始作为主力编辑器(称为 IDE 也行)来用了。我的游戏 Gravity Voyager绝大多数代码就是用它写的。于是自然我想用 VS Code 来调试 Archimesh python 脚本插件。不过,没有现成的解决方案,只有用 Pycharm/Eclipse 的方法。
所以,还是自己撸起袖子干吧。我参照 Pycharm 调试器的方法,写了一个插件脚本:
'''Debugging Support for Visual Studio CodePrerequest: PTVSD module should have been installed (using pip to install), also the 'Python' (by Don Jaymanne) plugin of VSCode.After this add-on installed and activated, press [Spacebar] then search 'connect', select "Connect to Visual Studio Code Debugger" to start forwarding debugging information to