[Bf-extensions-cvs] [b79cc04] master: light field tools: unify change tab category

meta-androcto noreply at git.blender.org
Mon Aug 15 16:00:04 CEST 2016


Commit: b79cc04f772aefab48e0a9769b1d0dae73198ec8
Author: meta-androcto
Date:   Mon Aug 15 23:59:43 2016 +1000
Branches: master
https://developer.blender.org/rBAb79cc04f772aefab48e0a9769b1d0dae73198ec8

light field tools: unify change tab category

===================================================================

M	light_field_tools/__init__.py

===================================================================

diff --git a/light_field_tools/__init__.py b/light_field_tools/__init__.py
index f1899b2..a552318 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



More information about the Bf-extensions-cvs mailing list