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

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