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:
authorCampbell Barton <ideasman42@gmail.com>2012-12-29 14:24:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-29 14:24:42 +0400
commit79c2571e56e79c28d6f22984112387d83782162a (patch)
treee634b4a3da1f60729d48172be667578f0b06f420 /release
parent18f134304c0c6181668a0a8c22289fcaeb472432 (diff)
user-preferences for addons. currently unused, example & docs still to come.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 1a80a32f957..4b5e2839cf1 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1162,7 +1162,8 @@ class USERPREF_PT_addons(Panel):
continue
# Addon UI Code
- box = col.column().box()
+ col_box = col.column()
+ box = col_box.box()
colsub = box.column()
row = colsub.row()
@@ -1225,6 +1226,25 @@ class USERPREF_PT_addons(Panel):
for i in range(4 - tot_row):
split.separator()
+ # Show addon user preferences
+ if is_enabled:
+ addon_preferences = userpref.addons[module_name].preferences
+ if addon_preferences is not None:
+ draw = getattr(addon_preferences, "draw", None)
+ if draw is not None:
+ addon_preferences_class = type(addon_preferences)
+ box_prefs = col_box.box()
+ box_prefs.label("Preferences:")
+ addon_preferences_class.layout = box_prefs
+ try:
+ draw(context)
+ except:
+ import traceback
+ traceback.print_exc()
+ box_prefs.label(text="Error (see console)", icon='ERROR')
+ del addon_preferences_class.layout
+
+
# Append missing scripts
# First collect scripts that are used but have no script file.
module_names = {mod.__name__ for mod, info in addons}