diff options
author | meta-androcto <meta.androcto1@gmail.com> | 2016-08-15 14:49:58 +0300 |
---|---|---|
committer | meta-androcto <meta.androcto1@gmail.com> | 2016-08-15 14:49:58 +0300 |
commit | 344ae07195a3208bd17091e588c65fdc881ccc53 (patch) | |
tree | 251ab6633169b3f59ac7fc8c11ca2fe790e5c3ca /animation_animall.py | |
parent | 820e795a4fa4bd3fab315fe823f5a2b2a8050202 (diff) |
animall: unify change tab category
Diffstat (limited to 'animation_animall.py')
-rw-r--r-- | animation_animall.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/animation_animall.py b/animation_animall.py index 25fb9bd1..9a4abb74 100644 --- a/animation_animall.py +++ b/animation_animall.py @@ -470,6 +470,34 @@ class ANIM_OT_clear_animation_animall(bpy.types.Operator): return {'FINISHED'} +## Addons Preferences Update Panel +def update_panel(self, context): + try: + bpy.utils.unregister_class(VIEW3D_PT_animall) + except: + pass + VIEW3D_PT_animall.bl_category = context.user_preferences.addons[__name__].preferences.category + bpy.utils.register_class(VIEW3D_PT_animall) + + +class AnimallAddonPreferences(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="Animation", + 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(): bpy.utils.register_module(__name__) |