Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/save_theme.py')
-rw-r--r--release/scripts/save_theme.py55
1 files changed, 48 insertions, 7 deletions
diff --git a/release/scripts/save_theme.py b/release/scripts/save_theme.py
index 73c23087cec..4b8f06c348f 100644
--- a/release/scripts/save_theme.py
+++ b/release/scripts/save_theme.py
@@ -3,10 +3,39 @@
"""
Name: 'Save Current Theme'
Blender: 234
-Group: 'Help'
+Group: 'Export'
Tooltip: 'Save current theme as a bpython script'
"""
+__author__ = "Willian P. Germano"
+__url__ = ("blender", "elysiun")
+__version__ = "1.0 11/05/04"
+
+__bpydoc__ = """\
+This script saves the current Theme in Blender as a Blender Python script.
+
+Usage:
+
+Use Blender's Theme tab in the User Preferences window to create and name your
+theme, then run this script from the File->Export menu to save it.
+
+It is saved as a bpython script, meaning that you can simply run it to change
+the current theme. By default it is currently saved under the
+"Misc" group, available only from the Scripts window "Scripts->Misc" menu.
+
+To appear in the menu, a theme saved with this script must be put in your
+Blender's scripts dir, that's what happens by default when you save one by
+yourself. If you don't know where this dir is, running
+
+import Blender<br>print Blender.Get("scriptsdir")
+
+on the Text Editor window (use menu or ALT+P to run it) will write the path on
+the console.
+
+Remember to edit your exported theme's source file to put your name and
+some information on it before sharing it with others.
+"""
+
# $Id$
#
# --------------------------------------------------------------------------
@@ -29,6 +58,7 @@ theme = Theme.Get()[0] # get current theme
# default filename: theme's name + '_theme.py' in user's scripts dir:
default_fname = Blender.Get("scriptsdir")
default_fname = Blender.sys.join(default_fname, theme.name + '_theme.py')
+default_fname = default_fname.replace(' ','_')
def write_theme(filename):
"Write the current theme as a bpython script"
@@ -39,11 +69,22 @@ def write_theme(filename):
fout.write("""#!BPY
-\"\"\"
-Name: '%s'
-Blender: 234
-Group: 'Theme'
-Tooltip: 'Change current theme'
+# \"\"\"
+# Name: '%s'
+# Blender: 234
+# Group: 'Theme'
+# Tooltip: 'Change current theme'
+# \"\"\"
+
+__%s__ = "????"
+__%s__ = "1.0"
+__%s__ = [""]
+__%s__ = \"\"\"\\
+You can edit this section to write something about your script that can
+be read then with the Scripts Help Browser script in Blender.
+
+Remember to also set author, version and possibly url(s) above. You can also
+define an __email__ tag, check some bundled script's source for examples.
\"\"\"
# This script was automatically generated by the save_theme.py bpython script.
@@ -55,7 +96,7 @@ import Blender
from Blender.Window import Theme
theme = Theme.New('%s')
-""" % (theme.name, theme.name))
+""" % (theme.name, "author", "version", "url", "bpydoc", theme.name))
for tsp in theme.get(): #
command = "\n%s = theme.get('%s')" % (tsp, tsp)