Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

April 12, 2013

Sublime Text 2 plugins

Sublime Text

It's relatively easy to remember the structure of the BPY API with sufficient practice. After plenty of enthusiastic hours experimenting with BPY eventually it didn't matter what program I wrote python scripts in. Some I wrote in the blender Text Editor, others in notepad++ or IDLE, and lately I've come to appreciate SublimeText2.

SublimeText has a nice API for writing plugins, and over the last 24 hours i've written 3 small plugins in an attempt to keep the python fu from getting much weaker from lack of practice.
- selected text to gist
- stringify typed words (avoids manually placing string quotes)
- point default browser at selected word or url

Blender Text Editor

I wrote most of these as Blender plugins for the Text Editor (link old post) a while back. Recently the blender Text Editor got updated with a form of autocomplete (ctrl+space after a dot) - while not as magnificent as intellisense-auto-suggest it's still great if you know what you're doing.

A small roundup of current features of the editor:
- duplicate line
- shift lines up/down
- auto complete
- line ruler (for 80 char mark)
- syntax highlighted
with addons:
- search selected (bpy docs / blenderscripting / stack overflow / python docs )
- eval current selection
- download gist by id
- upload gist as anonymous user
- active text to syntax highlighted 2d (can be modified to 3d) Text Objects

2 comments:

  1. Blender Text Editor and Sublime Text 2 are the one I am using a lot at the moment. Blender Text Editor is not bad and BPY Console is also nice.

    Wonder if we can make Sublime Text 2 to talk to BPY or Blender directly. And with the Ctrl+Space thingy.

    ReplyDelete
    Replies
    1. it would be nice to be able to import BPY as a module, when i first started out this was high on my wishlist. now it doesn't bother me, the blender python console has excellent introspection. The blender text editor detects if an external script has been changed, it will show the rescue ring and pressing it will prompt to reload from disk. (there's even an addon that checks this automatically, but i've never needed it)

      Delete

Please use Blender.StackExchange.com for python scripting questions unrelated to this post.