Theme Addon (+ custom theme!)

Hi, i’ve just created my first addon and want some feedback. this is my first real python project so i could really need some advice. the script generates a nested list from the paths where the theme settings are. then it uses the pickle module to save the list to a file. to open a theme file is just a matter of iterating through the list.
it’s designed to be low maintenance and should work even if new settings are added to the theme options.

however, i wouldn’t like to use the file browser to open a theme, but rather a dropdown menu which is generated by files in a specific directory. also the filebrowser for the save operator should default to the same standard directory. can anyone give me some hints on how to achieve this?

also general feedback is much welcome as i am a python newbie.

First version
here is a link to the addon together with two themes (one custom dark made by me + the default). Just rename it to “.zip” and unzip it
pasteall

Update 1
Here is a new version that uses zip compression to minimize the size of theme files.
LINK - rename to .zip
(for some reason, the “original” theme does not match the blender original, but that’s not the scripts fault but mine, just save a new original if you want)

Update 2 (current)
sorry for too frequent small updates, but this is a fix that gives higher precision to floats (previous implementations rounded them but this became unnecessary when compression was implemented).
LINK
Theme examples (rename to .zip)

Thanks!

thanks! I will try it as soon as I get home.

Hey, very nice, mow it is much easier to interchange themes.

THX, mib

Great Addon. Thank you JoS.

updated see first post

Very Nice Jos! This works great!

how do you work with this

i mean i extracted the last 2 themes and got 2 files

but then is there a script for this ?

mind you with all the changes in 2.5
i don’t know anymore how themes work or if you can save them or not !

Thanks happy 2.5

Ricky,
The first link he provided is a link to pasteall with the script. I just copy the script and made a new file under my addons directory. After that, in user preferences there are buttons at the bottom to load and save themes.

but if you change a theme is there a way to come back to the one i have now ?
cause i don’t want to loose it

and i assume that i won’t loose the user preference i set cause this has nothing to do with the theme
theme has only to do with colors !

also if i ioad a new theme then i have to save it under another name in propertie panel or it will be loss if i close the file

where theses themes are save now in 2.5 ?
under what file name can i find theses ?

Thanks

thanks

@RickyBlender
Currently Themes can not be saved in 2.5 that’s what this addon is for as it creates a “.btheme” file on your hard drive. if you want to be sure about your current theme, i’d suggest you backup the startup.blend. however you can also save the theme with the plugin before you do anything else and load the file (with the plugin again) to restore it. and yes, it does not alter user preferences.

but i tough this could be done a few months ago !
is it temporary of will never be able to save theme again ?
i mean i know they crated several new files and tough this would be like in 2.49 !

but if not save then your script will be very userfull indeed !

Thanks

@RickyBlender, i know that theme saving is on the blender todo, but if this script turns out to be sufficient, maybe it could be made official, i don’t know. i’m probably using to many newbie hacks in the code though. and it’s not done, i’d like the interaction to be a little different as described in the first post

I’ve run the script trying to save my theme to the new py3.2 blender.
http://img194.imageshack.us/f/screenshot20110316at916.png/
but I can’t click the “save theme” buttons in user prefs/themes

I cannot get this addon to work in either 2.56stable or build 35803.