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...

Showing posts with label blender text editor. Show all posts
Showing posts with label blender text editor. Show all posts

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

September 19, 2012

Text Editor Search Addon

Search pydocs for blender related things is now easier!

Update

Now added keymap for Text Editor window, Ctrl+I will display a search menu if there is text selected. This no longer piggybacks the rightclick menu as shown in the screenshot.

text_editor_extras.rar ( 4 search engines )

This addon adds to the header panel:
- a button to switch on all colour / syntax / ruler options.

The ctrl+i creates a menu with 5 options:
- eval selected text (useful for equations)
- now spawn search pydocs / bpy docs / blenderscripting / stack overflow

The search features open a browser on your system and connect to the various search functions of those websites, if possible.

more text editor addons

the others are located here

August 27, 2012

gist id to blender text file

I like to shuttle code between friends and github, this script allows me to download a gist directly into blender. It could be extended to name the blender textfile according to the gist filename, but I don't need that so if you are interested in learning json / py3 / blender that might be an interesting exercise for you.

- adds panel to text editor
- creates area to fill in gist id
- creates button to initiate download
- will create new filename inside blender with gist id
- will write (first) file found at the gist id.

If your gist has multiple filenames and you don't want the first gist, then you will need to add some logic to the filename selector towards the end of the get_raw_url_from_gist_id function.

Direct link to the addon version of this script, here