[Bf-extensions-cvs] [e595db2] master: Add Update Panel Name
meta-androcto
noreply at git.blender.org
Thu May 19 14:06:58 CEST 2016
Commit: e595db28563b16e5a324272207f436488829a10b
Author: meta-androcto
Date: Thu May 19 22:06:22 2016 +1000
Branches: master
https://developer.blender.org/rBACe595db28563b16e5a324272207f436488829a10b
Add Update Panel Name
===================================================================
M oscurart_tools/__init__.py
===================================================================
diff --git a/oscurart_tools/__init__.py b/oscurart_tools/__init__.py
index 1e3e461..04bd5c3 100644
--- a/oscurart_tools/__init__.py
+++ b/oscurart_tools/__init__.py
@@ -316,6 +316,55 @@ class OscPanelAnimation(OscPollAnimation, bpy.types.Panel):
row.prop(bpy.context.scene, "quick_animation_in", text="")
row.prop(bpy.context.scene, "quick_animation_out", text="")
+## Addons Preferences Update Panel
+def update_panel(self, context):
+ try:
+ bpy.utils.unregister_class(OscPanelControl)
+ bpy.utils.unregister_class(OscPanelObject)
+ bpy.utils.unregister_class(OscPanelMesh)
+ bpy.utils.unregister_class(OscPanelShapes)
+ bpy.utils.unregister_class(OscPanelRender)
+ bpy.utils.unregister_class(OscPanelFiles)
+ bpy.utils.unregister_class(OscPanelOverrides)
+ bpy.utils.unregister_class(OscPanelAnimation)
+
+ except:
+ pass
+ OscPanelControl.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelControl)
+ OscPanelObject.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelObject)
+ OscPanelMesh.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelMesh)
+ OscPanelShapes.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelShapes)
+ OscPanelRender.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelRender)
+ OscPanelFiles.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelFiles)
+ OscPanelOverrides.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelOverrides)
+ OscPanelAnimation.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(OscPanelAnimation)
+
+class OscurartToolsAddonPreferences(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="Oscurart Tools",
+ 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="")
##======================================================================================FIN DE SCRIPTS
More information about the Bf-extensions-cvs
mailing list