UI Customization : Enhancing Text Editor Header

.start

Recently I have been using the Text Editor in Blender quite a bit to learn about Operator writing and customizing the UI and i felt the need for some extra functionality in the Text Editor. So, today I went about solving that problem.

You can see the modifications I made in the image below

Features added: 

  1. Fake User toggle, 
  2. Column number display
  3. In case of external text files
    1. Ability to open the text file in external editor 
      1. Save and then open
      2. Pass the line and column number as well to the external editor
    2. Display if the text has been modified
    3. Ability to copy the name of the external file (CTRL+C while the mouse is on the filename) 

Custom Hotkey for text.launch_editor operator

Source Code

Modifications to the header draw method

bpy.ops.text.launch_editor Operator

For now I am looping though the lines of the text to find the line number. I am sure there is a better way to do this using the API. Will need to investigate.

Features in Blender that made the development a breeze

References

.end
satishgoda at gmail dot com

Comments

Popular Posts