Script to generate syntax highlighted Text Objects from Text Editor content

This script uses pygments (I can not help you install this). It relies on a monospace typeface, in this instance SourceCodePro by Adobe (An Open Source font family). The settings aren’t fully tweaked for generic use, but if you kind of know what you’re doing it won’t be a problem to get a lot more from it.

Each text unit is a unique object, so can be keyframed. The script generates materials automatically for cycles. You can adjust the material_library to your liking.

That’s it. Enjoy. (as an addon, details in 3rd post)

standing conditions:

  • None that i know of.

now as an addon, Makes new Panel in Text Editor called Syntax Objects, with a button Make Text Objects it will turn the currently active text in Text Editor into syntax highlighted 2d Text 0bjects in the 3dview.

Download, place in addons, addons_contrib, or addons_extern.

this code snippet will output all current materials, so if you modify the default theme and want to use it in the future you can overwrite that dictionary in the script.

modified the default theme

So what is this pygments?
The script crashes because I do not have that module. unzip, then something like

python3.2 install