First of all it's probably easier to show what this does:
in case it's not obvious, what's happening.
@0:00 I change the debugger to the new mixed mode native/python debugger.
@0:15 I set a break point in the .obj importer/exporters register function.
@0:30 break point hit, full support for inspecting python variables!
@0:36 But what if we want to trace into that native C register_class function? well just step into it! seamlessly! Also check out the call-stack!
- Visual Studio 2017 update 5 (15.5) with the Python native development tools option for the Python Development workload in the Visual Studio installer.
- PDB files for our python (linked below), they need to be copied to the win64_vc14\lib\python\lib folder, next to the .dlls I'll add them to svn if this diff gets accepted.
- WINDOWS_PYTHON_DEBUG (advanced option) will have to be set in cmake, to copy the pdb files to the right run-time location and create a little helper project blender_python_runtime_scripts that has all the scripts in it that blender uses at run-time.
-It's quite amazing and will save people developing on windows heaps of time.
-All of this is optional, if you don't want to use it, you don't have to and won't even notice it.
-Works in release mode (ie in a blender release build, you can still debug through any .py file you want)
Startup performance isn't great, however using the mixed mode debugger is optional, if you just work in C , just switch is back to the 'local windows debugger' and things will be as they always were.
given the blenders run-time files get populated during the INSTALL phase and cmake refusing to make a project with files that do not exist yet, populating blender_python_runtime_scripts is kind of a 'difficult'*cough*a dirty hack*cough*, you have to build the 'INSTALL' project then re-run cmake to populate the project. Not great. not great at all. however the benefit of being able to debug .py/c seamlessly imho is worth it. If someone has a better idea i'm all ears. I left a little readme in the project just in case someone gets confused about this.
some background information about the new support in visual studio here: