Skip to content
Snippets Groups Projects
Commit cf48f1c6 authored by meta-androcto's avatar meta-androcto
Browse files

Add Update Panel name

parent 8519564c
Branches
Tags
No related merge requests found
......@@ -38,7 +38,7 @@ class View3DPanel():
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
class VIEW3D_PT_add_menu(View3DPanel,bpy.types.Panel):
class VIEW3D_PT_Toolshelf_menu(View3DPanel,bpy.types.Panel):
bl_label = "Dynamic Toolshelf"
bl_category = "Dynamic"
......@@ -1390,6 +1390,34 @@ class VIEW3D_MT_undoS(bpy.types.Menu):
layout.operator("ed.undo", icon='TRIA_LEFT')
layout.operator("ed.redo", icon='TRIA_RIGHT')
## Addons Preferences Update Panel
def update_panel(self, context):
try:
bpy.utils.unregister_class(VIEW3D_PT_Toolshelf_menu)
except:
pass
VIEW3D_PT_Toolshelf_menu.bl_category = context.user_preferences.addons[__name__].preferences.category
bpy.utils.register_class(VIEW3D_PT_Toolshelf_menu)
class ToolshelfMenuAddonPreferences(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="Category",
description="Choose a name for the category of the panel",
default="Dynamic",
update=update_panel)
def draw(self, context):
layout = self.layout
row = layout.row()
col = row.column()
col.label(text="Category:")
col.prop(self, "category", text="")
def register():
bpy.utils.register_module(__name__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment