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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2016-08-15 16:59:43 +0300
committermeta-androcto <meta.androcto1@gmail.com>2016-08-15 16:59:43 +0300
commitb79cc04f772aefab48e0a9769b1d0dae73198ec8 (patch)
tree606498aa31dbc2267c2ec305f11ae84f6c0566c3
parent9b0f8ba3932434cdd150fedd11ef74518c3a7241 (diff)
light field tools: unify change tab category
-rw-r--r--light_field_tools/__init__.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/light_field_tools/__init__.py b/light_field_tools/__init__.py
index f1899b2d..a5523187 100644
--- a/light_field_tools/__init__.py
+++ b/light_field_tools/__init__.py
@@ -100,7 +100,33 @@ class LightFieldPropertyGroup(bpy.types.PropertyGroup):
min=0,
description="The spacing in pixels between two cameras on the focal plane")
+## Addons Preferences Update Panel
+def update_panel(self, context):
+ try:
+ bpy.utils.unregister_class(light_field_tools.VIEW3D_OT_lightfield_tools)
+ except:
+ pass
+ light_field_tools.VIEW3D_OT_lightfield_tools.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(light_field_tools.VIEW3D_OT_lightfield_tools)
+class LFTPreferences(bpy.types.AddonPreferences):
+ # this must match the addon name, use '__package__'
+ # when defining this in a submodule of a python package.
+ bl_idname = __name__
+
+ category = bpy.props.StringProperty(
+ name="Tab Category",
+ description="Choose a name for the category of the panel",
+ default="Tools",
+ update=update_panel)
+
+ def draw(self, context):
+
+ layout = self.layout
+ row = layout.row()
+ col = row.column()
+ col.label(text="Tab Category:")
+ col.prop(self, "category", text="")
def register():
# register properties